firebase_messaging: Difference and use cases of onMessageOpenedApp| getInitialMessage| onBackgroundMessage #6484
Unanswered
kristijorgji
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am using
firebase_messaging 10.0.2
flutter 2.2.2
There is no clear idea of use cases for those methods.
I will give example:
onMessageOpenedApp is never triggered in this scenario: app is killed, notification arrives and by clicking notification app is opened. In this situation
getInitialMessage
returns the notification which is great and correct, but method namedonMessageOpenedApp
you might expect to be triggered too.onBackgroundMessage
- is triggered when app is killed/not opened (i see it via flutter logs), but any idea when this might be used, some use cases ? We clearly cannot redirect to some page when app is not opened, one idea i wanted to use is prefetch data from api but need code adjustment as got errors di container not initialised yet as app is not even opened.Beta Was this translation helpful? Give feedback.
All reactions