Comments (10)
Hi @Shervanator ,
Thank you for taking the time to reply, much appreciated.
It seems similar to the issue you quoted #7770 but still slightly different in this case, because
- background messages are working
- the push notifications are not data only.
It is interesting what you described above with what is happening after Force close and sending again. Unfortunately, that is not working for me. I briefly tried that with both of our apps and didn't seem to work. The only difference in what I did is me sending from AWS SNS - later I will try using the Firebase console too.
I was playing around with setting "messaging_ios_auto_register_for_remote_messages": false
and registering manually in the code with await messaging().registerDeviceForRemoteMessages();
but that didn't make any difference.
I will let you know if there is any progress.
Thank you,
Tibor
from react-native-firebase.
Okay I've narrowed my problem down, not sure if its similar to what you are seeing:
- Fresh install app
- Register for provisional push notifications
- Send message containing data to app
- onMessage does not fire
- Force close app
- Send message containing data to app
- onMessage now does fire
So maybe I'm running into a different issue, but that is my reproduction steps...
from react-native-firebase.
Seems like the same issue as: #7770
I am also noticing this... onMessage is not firing very often (was working reliably in the past), I am occasionally getting it to fire on iOS, but can't identify anything in particular thats making it work?
I did upgrade to react-native-firebase v19.2.2 yesterday (was previously on v16) but rolling back to the old version doesn't seem to help...
I wonder if this is something to do with Firebase/Apple? π€
(btw everything is working fine on Android)
from react-native-firebase.
Okay I have noticed one slightly strange thing...
- Install fresh version of my app
- Register for provisional push notifications
- Get FCM token and send a message via Firebase messaging UI => I get nothing when the app is open
- Force close App
- Send a message via Firebase messaging UI => I see the provisional message
- Tap the message => Opens the app
- Send a message via Firebase messaging UI => onMessage fires successfully
So it seems like after clicking the firebase message once will result in onMessage starting to fire correct again on iOS? π€
from react-native-firebase.
Very interesting - that's good testing...
- would be interesting to know the exact FCM contents you can post the FCM REST API (with a different device token, of course) to trigger this behavior so anyone trying things can know with certainty they are reproducing exactly the same
- it appears something about the app device API usage around notification registration or token creation or something similar has an issue. Maybe a race condition maybe something else? It looks like there is a missing step 1a of "open app first time", and 5b "open app again" since we are talking about foreground onMessage receipt yes?
- something that is happening either in step 2 permission post / accept and 5b "open app again" (app initializes...) needs to also happen either in 1a "open app first time" or after 2 (permission post / accept) it seems?
from react-native-firebase.
Thanks for the reply @mikehardy!
- The payload I'm currently sending for this test is via the firebase messaging console UI, its a simple message with a title, body, and a data payload. I realise this isn't really data-only, but at least on Android (and I believe on iOS in the past) the app would still have onMessage called so it could handle the push notification without showing the alert in the notification centre. Tomorrow I can try sending a payload via the FCM server side api and send through the exact payload...
- Yep this is in regards to foreground onMessage
- I'll have a little peak into this to see if I find any more interesting info...
from react-native-firebase.
Thank you @Shervanator & @mikehardy for taking the time to check, it is really appreciated.
In my case the onMessage is working correctly when sending the notification from the Firebase Console.
Unfortunately, switching to sending through Firebase is not an option. Our backend have AWS SNS built in and no intention to re-structure it.
Is there a way through APNS payload to force the onMessage to react? This is what we are sending:
{
"aps": {
"alert": {
"title": "Tibor testing",
"body": "Test001"
}
},
"url": "https://www.azonetwork.com"
}
I tried to add "sound": "default"
and "badge":1
- still the same.
Any help would be appreciated.
from react-native-firebase.
Unsure but I think you may need the high priority keys? A differential comparison of what your system sends vs what works when you send via the FCM REST API (so you have complete control of the JSON, critical here during testing) is how I'd go about it
from react-native-firebase.
Related Issues (20)
- [π] Bug Report Title - CHANGE ME The token obtained by getToken has always been an invalid token
- [React Native][iOS] Consent mode v2
- :fire: You need to update react-native-firebase to get new firebase-ios-sdk that complies with App Store Privacy Manifest requirements HOT 8
- Firestore encountered gRPC-C++ error while upgrading Firebase module to 19.2(iOS) HOT 1
- [π] Documentation Issue - site was down, it is back up HOT 1
- [π₯] Fastlane (iOS) error during compile error on this library HOT 3
- :app debug:x86 failed to configure C/C++ Failed C/C++ configuration. java.lang.IllegalStateException: Failed C/C++ configuration. HOT 3
- [π] AppCheck usage sky rockets after update HOT 2
- [π] Invariant Violation: `new NativeEventEmitter()` requires a non-null argument. HOT 1
- [π] π₯ @react-native-firebase/messaging (Android) - Messaging() gets the wrong ReactContext when there is another Activity instantiated by ReactInstanceManager? HOT 10
- π₯Can't able to run react native android app with @react-native-firebase/perf": "19.1.0 and above HOT 1
- iOS Data Only FCM messages not reaching device HOT 3
- [π] pod install issue after added library HOT 2
- [π] FirebaseCoreInternal/FirebaseCoreInternal.modulemap' not found after XCode required to download iOS 17.2 HOT 4
- [π] π₯ remote config method `fetchAndActivate()` inconsistent with method `fetch()` and then `activate()` on iOS only
- [π] [ANDROID] Duplicate class com.google.firebase.Timestamp HOT 7
- [π] Bug Report Title - java.lang.RuntimeException: Could not invoke RNFBFirestoreDocumentModule.documentOnSnapshot only android HOT 1
- [π] CocoaPods could not find compatible versions for pod "Firebase/Messaging" HOT 2
- [π] 'FlipperKit/FlipperClient.h' file not found HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-firebase.