Push Notification Token returning InvalidRegistration

Please provide the following:

  1. SDK Version: 40.0
  2. Platforms(Android/iOS/web/all): iOS & Android
  3. Add the appropriate “Tag” based on what Expo library you have a question on.

I’m having an issue on ios with Push Notifications

I’ve built and released the app on the Play Store following the FCM guide, meaning

  • getting the json config for the app to get FCM token
  • getting server key to be able to send notifications from the server
  • all of it worked like a charm

Then when I got to iOS, followed the guide as well

  • got the PLIST file
  • added the file to the app and built it
  • when configuring the app on Firebase console, I got asked the .p8 file, the one generated/added by Expo was no longer downloadable
  • I added a new one and replaced the one on expo using the credentials manager
  • replaced the provision profile as well
  • Built the app, released it
  • Token are generated, up to this point everything seems fine
  • Now trying to send message to the iOS device always resulted in the same response

I can’t tell what I’ve gotten wrong, I’ve been trying everything and reading anything I can to no luck

Here are the steps I followed

  • On Apple Dev Account

    • Added a key
    • Added a Provision Profile
    • Added both on Expo Credentials(verified all the IDs, everything checks out)
  • On Firebase Console

    • Added iOS app
    • Fill in the Apple informations(Team ID, bundle, etc…)
    • Downloaded the plist file
    • Uploaded the .p8 file
    • Copied the Server key to the backend server
  • On the App

    • added the plist file path in the app.json
    • built the app
    • fetched the device token(seems legit, 64 chars long)

But when I try to send a notification to the iOS devices it doesn’t work, but on Android everything works like a charm.

What am I missing?

Please help, I’m out of tricks or solutions, there must be something I misunderstood or not well explained in the documentation, I’ve gone through the implementation gazillion times to see where I made a mistake and I couldn’t get my head around it nor point it.

Please help a brother out

Please check with both the side app side and your side that the exact same registration id is stored in the server which Application on mobile receives it in on onTokenRefresh method. You should have received the exact same registration token as developer got in FirebaseInstanceId.getInstance().getToken()

As i got your comment and you’ve updated the code here is some change in your code it is from google doc it self.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.