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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[馃悰] ios - setMessageBackgroundHandler not called after device reboot #6711
Comments
Is that js code in index.js, prior to the AppRegistry call to register the app? If it is, I think this may be another specific case if the general problem that data only notifications are not guaranteed to deliver. In that case, is a notification extension handler not able to add quick actions in an FCM with notification block? I wasn't aware that was a limitation but it might be If it's in the App code and not index.js, move it to index.js and retry? |
Thanks a lot for your answer @mikehardy index.js :
and initMessaging file :
The function initMessaging is async due to the async function from notifee called inside
|
Perhaps. With no toplevel await I use the old style in my index.js, method().then().catch() in my app. You might experiment |
I tested with a very simple handler :
Notification does not show up after a device restart, unless the application has been opened once. |
You could always put a native code log in your AppDelegate to trace program execution through it (stackoverflow has good examples of this, and it seems you know how to get native device logs, but just in case - you can make an obvious tag, then use Console.app to watch device logs and filter for the tag). This seems like it falls into the "no guaranteed delivery" bucket to me. The app has not run and the system does not seem to want to start it just for a data-only message |
Hello @mikehardy
Everything seems to work fine, even the onBackgroundEvent is well triggered after a device restart without having launched the application once. I think we could add some documentation about it : "if you want to use apns category, we highly recommend to switch to new firebase api" |
PS: I forgot to mention that our target is having push notifications with quickActions on iOS. I tested with android, and for now, it doesn' work |
As someone who has looked at the documentation far too much to know where new users might first notice things, could you hit the edit button at the top right of whatever page seems best for your suggested documentation update? Github has a web PR flow for docs that makes it pretty painless - just takes a couple minutes 馃檹 As for the quick actions that may be a Notifee issue (probably is, I should say...) |
Hello 馃憢, to help manage issues we automatically close stale issues. This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
Thank you for your contributions. |
Issue
Hello and thanks for your super work making firebase awesome for react native !
On our app we are setting up data-only notifications (no notification key in the payload sent to firebase). The payload sent to firebase through the legacy api is the following one :
Our dependencies are :
In our setBackgroundMessageHandler() method, we display a notification using notifee and it works perfectly on android.
On Ios, we are meeting an issue : When device is powered off and powered on, data-only notification seems to not be handled by application (which has not been started since reboot)
To reproduce on ios:
Below the js code setBackgroundMessageHandler :
Nothing happen on our app.
Is it only happening on our app or is it a known issue ?
NB: this scenario is well working on android
NB2: We really need to use data-only notification because we are in some cases displaying notification with quick-actions.
Project Files
Javascript
Click To Expand
package.json
:firebase.json
for react-native-firebase v6:iOS
Click To Expand
ios/Podfile
:AppDelegate.m
:Environment
Click To Expand
react-native info
output:react-native-firebase
version you're using that has this issue:e.g. 16.4.5
Firebase
module(s) you're using that has the issue:e.g. Instance ID
TypeScript
?Y
React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: