-
Notifications
You must be signed in to change notification settings - Fork 4k
🐛 [firebase_messaging] IOS firebaseMessagingBackgroundHandler never called ! #9563
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
@hatemragab Can you provide |
@darshankawar thanks for your time |
Is the app minimized or terminated when you try sending notifications that they are not received ? |
Two cases not received |
Yes, I ran the messaging example on iOS device using latest master version of the framework. Updated the fcm token in RPReplay-Final1663584024.MP4
When you run the same plugin example, do you not get same behavior as above ? |
I will upgrade flutter sdk to lasted version |
I will explains in details what i have done while testing
|
Thanks for the effort in sharing these details and also for your patience on this @hatemragab I tried in two ways. First without giving permission -> sent notification through script which were received properly as below:
Second, after giving permission and then ran script thrice, for which below are the logs:
Having verified as above, but based on your report and observation, I am going ahead and keeping this issue open and label for further insights from the team to see what they think of this entire |
so wired on the other hand if i implement this code in my ios native project
the |
@russellwheatley hope you can help me there |
@hatemragab we face this issue only as described in #9536. But I just saw you are testing on iphone old models and we have not tested on that phones yet. Can you test also on a recent iphone? |
Okay I will try but any way it should working on this version |
@hatemragab can we see your notification json? |
|
Try this. At first glance, you are missing push-type background Notification Sample Payload: |
I have updated and same bug here
|
Then it should be device settings. |
Im facing same exactly problem in ios 15.6, the background handler not ever invoked |
Yea I forgot about it 😊 Maybe #9581 nailed it and this is the same issue which behaves differently on different iphone models / ios versions. That would also explain why @darshankawar cannot reproduce issue on his device. |
Hello everyone, we’ve reviewed the issues opened for iOS background messages and we want to make our position clear. Android and iOS handle background messaging differently. The decision made by the iOS operating system whether messages reaches the relevant iOS event handler (and subsequently received by the Dart background messaging handler) is based on a number of criteria, such as: CPU usage, priority level (data-only messages are considered “low priority” by iOS, android does not), battery level, amount of messages being received by the app, background/terminated application state, etc. This is a fundamental difference between the platforms, and you need to be aware of them when designing your application. One solution suggested for iOS data-only messages unreliability has been to add a NotificationExtension. But this will still not create parity with Android as you will still have to include a notification with your message (therefore not data-only). It will still render the original notification if you do not update/mutate the notification that comes through the system in a timely manner. We are not currently considering this as a solution due to these limitations. We also will not support non-FCM messages from third party packages. We specifically only support messages received from the Firebase APIs since we cannot guarantee that messages received from third party packages will not have any unintended side-effects on other Firebase products such as messaging delivery reporting and Analytics data. To help us triage and locate genuine issues that need to be addressed we have created a specific issue template for iOS background messages. If you believe you still have an issue that needs to be addressed, please create a new issue following this template. I will be closing this issue in favor of raising a new issue with the new template above. This template will help you provide us with all the information we need to investigate a potential issue with background messaging on iOS. |
I can understand the team decision, but unfortunately I think this doesn't completely solve the problem. @iosephmagno just in case you did'nt know, the developer of Awesome Notifications plugin (a local notif plugin) released yesterday his own Awesome Notification FCM plugin. He created it so both plugins are tailored to fit well together in a timely manner. This should be compatible with mutable content flag etc. |
@scalz Thanks for the advice. We are in touch with Rafael and already sponsored Awesome. Due to limitations on iOS, more and more companies are deciding not to use FCM on iOS (see here https://pub.dev/packages/push). But I think it would be best if we could use firebase_messaging for both platforms. |
@darshankawar @russellwheatley can I suggest to add this discovery about "Notifications and Encryption on iOS" in your Readme? It took several weeks for us to understand we had an issue on iOS. Basically, you can warn people that if they use encrypted content in their notifications, then firebase_messaging is currently not a valid solution for iOS. Without encryption, they can use remote-notification on iOS (to avoid throttling) and either remote-notifican or silent-notifications on android, and we've found that the plugin works great in that scenario. |
thanks for advice |
i have created a repo to prove that the swift project background handler works in the native app
but in flutter firebase messaging it not working
and always
getInitialMessage
returns null on iOS #9462prove_bacground_handler_ios_works
issue number #6290
say that the example of #9292
fix it but actually, the bug still exists
i have run the example here official package example
example
the same bug exists because of the project written in objective c I cant create a pull request to fix it #9562
since it works in the native swift project!
prove_bacground_handler_ios_works
The text was updated successfully, but these errors were encountered: