-
Notifications
You must be signed in to change notification settings - Fork 4k
[firebase_messaging]onLaunch is not fired and can't save dismissed notifications #1838
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
Comments
call _firebaseMessaging.configure(...) before super.initState(); of your stateful widget |
@Hyla96 What mechanism are you using to send the notifications? |
Following the documentation on how to receive messages where it states the difference on how Notifications and Data Messages are handled, I think this #1644 might be related; I tested a message without the So, there should be a Notifications and a Data Messages sent to a device to handle all app states cases? 🤔 I don't think so. There are multiple issues with comments of possible solutions that I'm not been able to test:
|
@fxsalazar Did you try with a iOS device? The problem seems to be only on iOS. Android works fine. |
Yes, I've only tested it on a iOS device. |
@fxsalazar Weird.. I have a notification that looks like this:
So I don't have a notification tag but the onLaunch still don't fire up. I don't understand what i'm doing wrong.. |
Worth noting: I'm using version |
@superakabo did you sent "click_action":"FLUTTER_NOTIFICATION_CLICK" also on payload ? without that also works? |
Also experiencing this when sending both notification and data payload on iOS |
The onResume works well for me. The onLaunch is only executed after about 2 minutes. By then the user is probably already gone. |
Closing in favour of trying the latest messaging version which has been been heavily reworked, along with documentation, since this issue was raised: https://firebase.flutter.dev/docs/messaging/overviewIf you still have a problem please raise a new GitHub issue with up to date information and code snippets if possible. Thanks. |
I've set up my app to receive notifications. I receive notifications while app is in foreground and onMessage fires properly.
If I have my app in background, onResume fires aswell, but just if I click the notification, if I dismiss it and than re-open my app from the background, nothing fires and I lose a notification.
onLaunch never fires, If I send a notification while my app is terminated, nothing happens. When I open it, after a while onMessage fires with the notification I sent while my app was terminated.
I need to save Notifications locally, so users can read them in-app, however, if they dismiss the notification (As 90% of people do when they get a notification and they are busy) I can't save it because no callback is fired.
Steps to Reproduce
JSON:
Add to Manifest:
Inside my app:
The method:
_printMessage(Map<String, dynamic> _message , String _string)
Saves in a local database the notification recived
Expected results:
onResume and onLaunch fires when I get a notification and my app is in background / terminated.
Actual results:
onLaunch does never fire;
onResume fires only when app is in background (still running) and user presses over notification;
Logs
The text was updated successfully, but these errors were encountered: