Giter Site home page Giter Site logo

Comments (10)

tiborazo avatar tiborazo commented on June 3, 2024 1

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.

Shervanator avatar Shervanator commented on June 3, 2024 1

Okay I've narrowed my problem down, not sure if its similar to what you are seeing:

  1. Fresh install app
  2. Register for provisional push notifications
  3. Send message containing data to app
  4. onMessage does not fire
  5. Force close app
  6. Send message containing data to app
  7. onMessage now does fire

So maybe I'm running into a different issue, but that is my reproduction steps...

from react-native-firebase.

Shervanator avatar Shervanator commented on June 3, 2024

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.

Shervanator avatar Shervanator commented on June 3, 2024

Okay I have noticed one slightly strange thing...

  1. Install fresh version of my app
  2. Register for provisional push notifications
  3. Get FCM token and send a message via Firebase messaging UI => I get nothing when the app is open
  4. Force close App
  5. Send a message via Firebase messaging UI => I see the provisional message
  6. Tap the message => Opens the app
  7. 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.

mikehardy avatar mikehardy commented on June 3, 2024

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.

Shervanator avatar Shervanator commented on June 3, 2024

Thanks for the reply @mikehardy!

  1. 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...
  2. Yep this is in regards to foreground onMessage
  3. I'll have a little peak into this to see if I find any more interesting info...

from react-native-firebase.

tiborazo avatar tiborazo commented on June 3, 2024

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.

mikehardy avatar mikehardy commented on June 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.