FCM messages not arriving when app is newly installed #6256
Replies: 1 comment
-
You mention you have bumped things locally to latest, may I assume (dangerous, so please confirm) that means you have tried v14.9.4 with the new firebase-android-sdk 30.0.1 in it? That one is pretty new and it is the first time we have updated the android SDK in a while because of a tangle of problems with the auth emulator. It may affect things. At heart my first suspicious is that there is something in firebase-android-sdk as the messaging receipt is all handled by pretty low-level services in that SDK, with no control assumed or needed at the react-native-firebase level Might be interesting to see if there is any cluster of android API level (perhaps only API31 / Android 12?) or device (perhaps it's mostly Xioami and Huawei because they are notirious https://dontkillmyapp.com) - but you mention you can see it on the android emulator as well, so this seems low probability I believe you can probably reproduce it with a native example and get support from firebase-android-sdk, you might try modifying their skeleton to see: https://github.com/firebase/quickstart-android/blob/master/messaging/README.md Other thought: total workaround, but perhaps, maybe just maybe, you could have a post install lost message detection / try to fix loop.
The '?' may be to invalidate the token and re-register? to double check permissions? or ? - at minimum you could perhaps add the device to a collection of devices / users that are having problems, and you can give the user direct feedback right there that they may want to uninstall reinstall, and you could queue it for QA or customer care follow up, upload logs, or ? Pretty vague but I'm brainstorming on your behalf - hopefully it's mildly useful - I think the real progress will come from a quickstart and firebase-android-sdk support, if you've demonstrated you can reproduce it, even sometimes, at the react-native-firebase layer I'm pretty sure you'll be able to reproduce it at the native layer, and there will be an SDK bug somewhere/somehow |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there. Thanks a lot to the Invertase team for this beautiful library and for Notifee.
I didn't post this as an issue because, being mainly a backend developer, I'm under the assumption that I am misinterpreting some parts of the RN Firebase/Notifee documentation and not using them correctly.
This is my initialization of messaging and notifee in my componentDidMount method.
This is my package.json
I agree I'm not using the very latest versions of both notifee and react-native-firebase, but if it can help I have tried to quickly bump them in local and didn't get any improvement.
Basically, I have been receiving complaints about notifications not arriving sometimes in Android. "Sometimes". I went to the Firebase reporting and noticed indeed a 12% delta between messages sent and messages received. Firebase support have confirmed they are not throttling my Firebase project's notifications and not considering them spam (my first assumption was throttling because every message of this is high priority, since they are basically incoming "calls" handled this way while I properly implement callkeep).
So I went back to debugging in the simulator and discovered a weird behaviour. The app is installed on the simulator, by the console I can see the flow going as expected, token gets retrieved and registered on my server correctly, but first messages don't arrive. Doesn't matter the app state, no listener is fired. How comes following messages arrive? I don't know... it can be time related (15/20 mins?), it can be related to app being closed/force stopped/reloaded, it can be... a ghost somewhere in the code.
There is a complete randomness in terms of what I must do before to start receiving messages. When the first one comes in, then all the following come in correctly without missing a single one.
On iOS everything is fine (of course as long as user gives permission), messages are always received from the very first run.
I would appreciate any help you may provide.
Beta Was this translation helpful? Give feedback.
All reactions