-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getInitialMessage like FirebaseMessaging #576
Comments
@darwin-morocho We don't have anything like that right now, but we will investigate adding something similar |
Hi @darwin-morocho I'm experiencing the same issue. I need to navigate in the terminated state but cannot find any alternative to getInitialMessage for OneSignal. Have you figured out a way to handle this with OneSignal? Any help would be appreciated. |
Hello guys I am working on a Flutter project where I need to handle notifications using OneSignal. The app needs to open a specific status screen when a notification is clicked, but this isn't working when the app is completely closed. Here's a brief outline of the issue: The OneSignal initialization doesn't happen in main.dart because the OneSignal app ID is fetched from a backend, so I can't statically initialize it.
I'm looking for suggestions or best practices on how to handle this scenario effectively. Specifically, how can I ensure that the notification click listener works even when the app is completely closed? Any advice or insights would be greatly appreciated. Thank you! |
Description:
With Firebase when the app is closes and then we got a push notification we can use
getInitialMessage()
to check if the app wasopened by clicking in a push.
like this
But with onesignal we have to use
The above code is not a good solution because if the app was closed and opened without a push that code never won't be executed. A posible solution could be using a timer and if the above code is not executed after some milliseconds we can asume that the app was not opened using a push notification but that is not a good solution too.
The above code Only works on Android
Environment
onesignal_flutter: ^3.3.1
Is there a method like
getInitialMessage()
In OneSignal with flutter ?The text was updated successfully, but these errors were encountered: