question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Token generated but couldn't receive notificatios sent from fcm in iOS only

See original GitHub issue

I’ve set up all the instructions mentioned on this package and PushNotificationIOS by react native. https://facebook.github.io/react-native/docs/pushnotificationios.html

onRegister gets called and token is generated successfully but I couldn’t get any notifications on my iPhone sent from firebase.

It’s working fine on Android.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:6

github_iconTop GitHub Comments

3reactions
justmesamcommented, Jun 6, 2019

I figured out what was happening, when your onregister gets called it generates a device token and not an FCM token for iOS but generates FCM token for Android. So that’s why you could receive notifications on Android and not iOS since Firebase sends notifications using the devices FCM token but not the device token.

What I did was set Firebase for iOS following this. And then I created a RN bridge that sends the FCM token received from the Firebase setup to the front-end, I accessed it using NativeModules and then I could get the FCM token to the servers and everything works fine.

2reactions
dophlincommented, May 24, 2019

+1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firebase Notification To Device with FCM Token Says Sent ...
Does anyone know why the notification is being marked as sent in the firebase notification console but not showing up on the device?...
Read more >
Notifications - Expo Documentation
The expo-notifications provides an API to fetch push notification tokens and to present, schedule, receive and respond to notifications.
Read more >
Error on FCM Token for Push Notifications
I get the following error locally: APNS device token not set before retrieving FCM Token for Sender ID '805874615458'. Notifications to this FCM...
Read more >
Debugging Firebase Cloud Messaging on iOS
Key contained an invalid or malformed FCM-Token" means the server key is probably incorrect. Make sure you've copied the whole thing correctly ...
Read more >
Set up a Firebase Cloud Messaging client app on Apple ...
The FCM SDK performs method swizzling in two key areas: mapping your APNs token to the FCM registration token and capturing analytics data...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found