OneSignal / OneSignal-Flutter-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your flutter app with OneSignal
https://www.onesignal.com
Other
625 stars 214 forks source link

[question]: both addForegroundWillDisplayListener and addClickListener not triggered with hms (huawei). #870

Open Dicksenz opened 7 months ago

Dicksenz commented 7 months ago

How can we help?

Any fix for that ?

Code of Conduct

jennantilla commented 7 months ago

Hello @Dicksenz thank you for your patience! Can you share a bit more about how and where you've added these methods? Does anything interesting pop up in the logs?

We'll work on trying to reproduce this!

ihijazi commented 3 months ago

Been having similar behavior, not only on cold start.

My app uses some native code for some other SDK. The other SDK had GeneratedPluginRegistrant.register(with: "xxx"), and it was placed AFTER GeneratedPluginRegistrant.register(with: self).

The GeneratedPluginRegistrant.register(with: self) has to be at the very end, for both Android and iOS.

example for swift:

        GeneratedPluginRegistrant.register(with: xxx)

        GeneratedPluginRegistrant.register(with: self) // this has to be at the very end

        return super.application(application, didFinishLaunchingWithOptions: launchOptions)
    }

Tested with latest 5.2.2 and working fine.. all handlers as expected.

Hope this helps someone.