React-native-push-notification: Problem with IOS token

Created on 13 Oct 2016  路  12Comments  路  Source: zo0r/react-native-push-notification

Hi, I'm perfect with Android, but with IOS I don't know why when I try to send a notification using the token generated, it says invalid token in Firebase Cloud Messaging. What could be wrong?

I'm working with RN 0.26.2 and RNPN 1.0.7

Thanks!

Stale

Most helpful comment

Hi @mohamed-alashry @damathryx! sorry for the delay in the response. Now I'm using react-native-fcm

All 12 comments

@agrass I got the same problem? how did you solved this?

did you found any solution?

Hi @mohamed-alashry @damathryx! sorry for the delay in the response. Now I'm using react-native-fcm

The token fetch by react-native-push-notification is not good if you are using Firebase Cloud Messaging. Take a look here: https://stackoverflow.com/a/44000335

@theohdv I am experiencing this problem. How can I solve this? I have no knowledge in objective C.

To get the FCM token you can use this library react-native-firebase. There is a getToken() method which fetch FCM token.

@theohdv thanks, i just went with agrass solution use react-native-fcm and im getting the correct token now.

Was struggling with this for weeks, recreating projects and certificates trying to fix the issue. Turns out it's just the library is broken since 2016.

react-native-firebase needs newer RN version, so probably need apn for ios and firebase tokens for android. I am ending up using two separate libraries on server side.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

Same issue

Hi,
This is the expected behaviour since Firebase is not the official notification provider for iOS, Firebase for android.
The token is the APN one, you will need rnfirebase to get the Firebase token for iOS.

Was this page helpful?
0 / 5 - 0 ratings