I did try all true/false combinations of enableInAppAlertNotification() and "notifications_when_active". Two scenario appends when app is in foreground: 1) the native alert box is displayed and onNotificationOpened() is called, 2) alert box is not displayed and onNotificationOpened() is not called. I would like it happen like said in the documentation: "enableInAppAlertNotification() By default this is false and notifications will not be shown when the user is in your app, instead the NotificationOpenedHandler is fired."

I have OneSignal 2.3.9 with cocos2d-x 3.13

When app is in background or closed, everything is fine. The native alert box is not displayed when I tap the notification and I can manage it inside onNotificationOpened(). And also I wonder why onNotification() is never called? What is the difference between both callback?

Thank you.

Tuan Anh answered

    this bug seem to be happened with OneSignal 2.3.9. @yinjimmy I just create new project, then add onesignal with sdkbox. And everything happens same with the above post.

    Tuan Anh answered
      yinjimmy 1.17K Rep.

      onNotification is DEPRECATED callback, as using by previous OneSignal SDK.


      just use onNotificationOpened right now.

      yinjimmy answered

        never mind

        I removed cocos2dx sdkbox onesignal and installed onesignal SDK native Android and iOS

        yinjimmy commented

          Question stats

          • Active
          • Views2441 times
          • Answers3 answers
          • Followers1 follower