iOS: Invalid registration token. Check the token format

Shreejay Pendse picture Shreejay Pendse · Dec 27, 2016 · Viewed 8.7k times · Source

I am new for Firebase as well as for iOS. I am trying to send push notification using FCM.

I registered an iOS app on FCM. Both .p12 certificates added. Code developed according to FCM.

While sending notification through the Firebase Console, I'm getting the error Invalid registration token. Check the token format.. I don't what mistake I did.

FCM Console

Answer

Aditya Deshmane picture Aditya Deshmane · May 16, 2017

There are two tokens you get at iOS side

  1. Token generated by iOS which is received in method didRegisterForRemoteNotificationsWithDeviceToken

  2. Token generated by Firebase FIRInstanceID.instanceID().token() (this you can print in AppDelegate)

The issue you are facing is because firebase console portal requires token received by way 2 and you are using token received by way 1.