OneSignal-Cordova-SDK
OneSignal-Cordova-SDK copied to clipboard
setNotificationOpenedHandler never fired with onesignal-cordova-plugin 3.0.4 (OneSignal:4.7.3)
Hello,
I'm getting notification on my Device, but setNotificationOpenedHandler is never Fired (Using ionic).
Onesignal-cordova-plugin 3.0.4 OneSignalSDK : 4.7.3 OneSignal.setNotificationOpenedHandler(function(data){ alert("Notification opened"); //Never displayed });
The app is opened when Notification clicked.
I was using Onesignal-cordova-plugin 2.11.4 (OneSignal 3.16.0) It was working quite fine, except for Android 12. Notification was not received. With OneSignal 3.16.0 on Android < 12 (Onesignal-cordova-plugin 2.11.4), when clicked Notification is well received and the callback fired.
Now, with OneSignalSDK 4.7.3 (Onesignal-cordova-plugin 3.0.4), as said, Notification is received on Android 12. But when clicked nothing happens (OneSignal.setNotificationOpenedHandler never fired )
What's wrong with
It's OK now.
But with another issue : When the app is opened and, then, notification is sent, a message is, sometimes, displayed indicating that the app was closed dur to a bug. Notification is well received.
If we click on the notification, expected work is done. This issue (notification crash while app is opened) is obsered on both a vitual Android phone (Android 7) and a physical one (Android 12).
@amouzigh Thanks for reporting. Ignoring the OneSignal-Cordova-SDK 2.x.x versions, can you tell us the issue you are seeing on 3.0.4?
When the app is opened and, then, notification is sent, a message is, sometimes, displayed indicating that the app was closed dur to a bug.
Could you explain this in more detail? Also, can you include a screenshot of the message?
Can you give us step-by-step of what issues you are seeing? Example:
- Open app
- Send notification
- Tap on notification
- setNotificationOpenedHandler fires
Hello @jkasten2 , Here are the steps: 1 - Open the App on an Android phone, 2- OneSignal init is fired 3- Send notification 4- The app is closed by Android. 5- Notification is received 6- Tap on notification 7- setNotificationOpenedHandler is triggered
Thank you for your support
Hi @amouzigh, to confirm, is the error on step 4?
4- The app is closed by Android.
If so, can you share a screenshot of the error displayed?
a message is, sometimes, displayed indicating that the app was closed dur to a bug
Closing due to inactivity. Feel free to reopen if this is still an issue