OneSignal-Cordova-SDK icon indicating copy to clipboard operation
OneSignal-Cordova-SDK copied to clipboard

setNotificationOpenedHandler never fired with onesignal-cordova-plugin 3.0.4 (OneSignal:4.7.3)

Open amouzigh opened this issue 2 years ago • 4 comments

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

amouzigh avatar Jun 30 '22 08:06 amouzigh

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 avatar Jul 05 '22 11:07 amouzigh

@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:

  1. Open app
  2. Send notification
  3. Tap on notification
  4. setNotificationOpenedHandler fires

jkasten2 avatar Jul 05 '22 18:07 jkasten2

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

amouzigh avatar Jul 07 '22 10:07 amouzigh

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

nan-li avatar Aug 12 '22 21:08 nan-li

Closing due to inactivity. Feel free to reopen if this is still an issue

emawby avatar Sep 26 '22 17:09 emawby