react-native-fcm icon indicating copy to clipboard operation
react-native-fcm copied to clipboard

Upgrading app version number results in a refreshed FCM token that does not work

Open fredrikp opened this issue 6 years ago • 5 comments

To begin with, my app is working fine and notifications are received in foreground, background and killed states.

Changing the code and restaring, including upgrading the build number causes no change in behaviour. Let's say that the FCM token the app receives is Token A. The token value remains constant while I make changes to the app.

Upgrading the version number of the app, e.g. from 2.4.1 to 2.4.2 causes a big problem in the app: When the app asks for the FCM token, the app now receives Token B. There is a change in the token. Normally, I would say that this is OK, just inform the backend of the new token. But the new token does not work.

Sending push notifications to the app using Token B has no effect in the app. Sending push notifications to the app using Token A works fine like before.

React Native version: 0.57.8 react-native-fcm version: 16.1.0 iPhone 7 Plus running iOS 12.1.4.

fredrikp avatar Feb 14 '19 12:02 fredrikp

I've been this issue happening when I install the app in my android device with ENVFILE=.env react-native run-android --variant=debug for debugging purposes. The only way I can get the PN to work is by installing the app with export ENVFILE=.env && ./gradlew assembleReleaseStaging within the android folder.

MaxiSantos avatar Feb 15 '19 14:02 MaxiSantos

Token issue found in our project also in iOS. The token is changed after changed our APP version. And push notification is not working.

"react-native-fcm": "^14.1.3",
"react-native": "0.57.8",

Is there any solution? It's very urgent because our APP not working in the production version. @evollu

prashen avatar Feb 21 '19 14:02 prashen

This sounds like it could be related to https://github.com/firebase/firebase-ios-sdk/issues/2365 and https://github.com/firebase/firebase-ios-sdk/issues/2438

JPig avatar Mar 03 '19 12:03 JPig

In your Podfile try with these versions pod 'Firebase/Core', '~> 5.15.0' pod 'Firebase/Messaging', '~> 5.15.0'

JPig avatar Mar 03 '19 12:03 JPig

Not using cocoapods, but I tried with Firebase SDKs 5.16.0 with no change. Now I've switched over to react-native-firebase.

fredrikp avatar Mar 04 '19 07:03 fredrikp