-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
🐛 [firebase_messaging] onBackgroundMessage is not called when a lot of notifications come in after killing the app [IOS-Android] #9667
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as duplicate.
This comment was marked as duplicate.
@baraaaljabban
Also, does the same behavior occur without using
Does the same behavior occur without this part ? ie, without localDB implementation and usage ? I am trying to narrow down external factors you have mentioned, so as to see if the behavior is solely occuring using plugin and handler method. |
For rest of the comments saying If you are seeing the issue on iOS for |
@darshankawar last time in this issue we talked about the Isolate and tried with that solution suggested, is it the same thing or you want me to try different thing? |
Yes, I am aware of that conversation, but I wanted to know if using It would be great if you could provide a complete demo app that we can clone and run at our end, so as to properly go through this behavior. |
Alright I'll do the demo of what's happening in the next day, please allow some delay @darshankawar |
Hi @darshankawar sorry for the late demo, but you can see that after killing the app, the notifications 2,3 are missing (not being saved in the local and the rest were okay and being saved) (so the sequance was like 1,4..9 and for known reason I don't know why some was not saved) but we can see all the notifications in the tray please let me know if something more is needed |
Thanks for these details. Couple of things:
|
Hey @baraaaljabban. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
Hi @darshankawar! sorry for the delay in response, however, please find the repo to the background notification & this one we use to send the notification from. |
Hi @Shubh66, some updates have been made across a lot of the packages. Can you upgrade to the latest versions of all the dependencies to see if you still experience the issue? |
I got that this issue is blocked: customer-response Waiting for customer response, but I don't have much to add |
I can reproduce the bug using the repo and API provided in #9667 (comment). I ran the app several times and I got varying results each time. A few have been put below. |
Hello @danagbemava-nc, may I ask please about the update on this issue, or when I can expect a fix for it. |
@darshankawar can you please help me a bit to give me some glimpse about this issue update's or when I can expect this issue to be addressed by the team, thanks!. |
/cc @russellwheatley |
Hello @danagbemava-nc, is there anything regarding this issue please! |
Hello there! any update for this issue thanks. |
Hi @Shubh66, there are no updates atm |
iOS background message handler will never be called when the app is in a terminated state. See documentation. If the user also quits the app on android, the behaviour is the same.
As far as reliability goes, I'm afraid that is the nature of messages. They won't always make it to the device. On top of that, the operating system (iOS and android) will throttle your messages if you send a lot to a device. There is nothing we can do about this except ask that you design your app with these considerations in mind. Thanks. |
Bug report
Describe the bug
the code inside the method of onBackgroundMessage is not being executed when the the mobile receives for example from 15 to 30 notifications after the app is killed, in this case you will see all the notifications in the tray, but onBackgroundMessage will not be triggered for each one of the notifications ( if you try to handle the notification message in anyway then not all of them are handled).
for example the server (using FCM service) sends 30 notifications in a raw with the messages from [1-30], and onBackgroundMessage you will be called for [1,4,6...30] so 2,3,5 will not be handled but you still can see it in the tray of the mobile (this is for example you might miss other numbers but most likely it will be from the first 10 notifications).
this is happening for both IOS and Android
Steps to reproduce
Steps to reproduce the behavior:
Expected behavior
all the notifications that come to the app should be handled if you send 15 then the 15 one should be handled
Sample project
Additional context
in my case I was saving the niotfications in the localDB then when I noticied that some notificaitons are missing
Notification payload
Flutter doctor
Click To Expand
Flutter dependencies
Click To Expand
The text was updated successfully, but these errors were encountered: