4

Currently we have devices using old GCM implementation.

Does anyone know if it's possible to use old existing GCM tokens when sending push messages using firebase cloud messaging APIs?

Or would the apps require the new FCM sdk implementation?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
JoshuaTree
  • 1,211
  • 14
  • 19

3 Answers3

8

Does anyone know if it's possible to use old existing GCM tokens when sending push messages using firebase cloud messaging APIs?

Yeah that is possible. FCM and GCM messaging api are the same. The only thing that is different is the url (gcm-http.googleapis.com/gcm/ vs fcm.googleapis.com/fcm/) but they point to the same server.

Also see server endpoints documentation.

Tim
  • 41,901
  • 18
  • 127
  • 145
  • Thanks for the answer. After thinking about this, I will need to test: A) Can the GCM app service handler firebase messages. B) When GCM token refreshes .... how to grab these and import to FCM – JoshuaTree Jul 20 '16 at 07:56
  • Can not answer that for you, seems like a different question too – Tim Jul 20 '16 at 08:07
  • Agreed, while I'm at it, will link this existing question with this thread: https://stackoverflow.com/questions/37623046/how-to-use-an-existing-gcm-token-within-another-firebase-project – JoshuaTree Jul 20 '16 at 08:19
  • 6
    a) GCM app service handler will not break due to Firebase Messages, but it will support only the features supported by the GCM handler. (example: no integration with analytics, or future features that will be release) b) GCM tokens and FCM tokens are the same token. They both use the same InstanceID api under the hood. (except the firebase implementation includes more improvements) – Diego Giorgini Jul 20 '16 at 15:29
  • It seems like I am getting error while using subscribeToTopic on token generated by gcm. – kirtan403 Apr 22 '17 at 15:18
  • @kirtan403 what are you trying to say – Tim Apr 22 '17 at 15:47
  • 1
    @TimCastelijns I was trying to subscribe that token generated by gcm api to a topic. But it says the token is invalid. full details here: https://stackoverflow.com/questions/43560395/ – kirtan403 Apr 22 '17 at 15:49
  • page not found? – JoshuaTree Jun 06 '18 at 15:03
  • @JoshuaTree what page – Tim Jun 06 '18 at 15:28
  • When i try to use GCM tokens with FCM endpoint, i get the `MismatchSenderId` error, did anyone encounter this issue? I tried using both the server keys the `legacy server key` and `server key` – Paras Diwan Feb 12 '19 at 17:25
0

GCM token and firebase token are not the same. I did a test and subscribed to both services and saw that both tokens are different. you'll have to be very careful when using tokens to make sure. some 3rd party libraries still want to use GCM tokens while others are using firebase.

further, if you take a GCM token and try to use it in the firebase cloud messaging console to send a message, it might not be received by the android client. this was my case. i had to ensure i had a FCM token.

j2emanue
  • 60,549
  • 65
  • 286
  • 456
  • When i try to use GCM tokens with FCM endpoint, i get the `MismatchSenderId` error, did anyone encounter this issue? I tried using both the server keys the `legacy server key` and `server key` – Paras Diwan Feb 12 '19 at 17:25
  • GCM token is not for FCM. they are different. – j2emanue Feb 12 '19 at 18:41
0

Yes we can use GCM token to push on FCM. See the below explanation:

Your GCM and FCM registration tokens are mutually interchangeable; you can send to existing GCM tokens through the FCM HTTP server APIs.

https://developers.google.com/cloud-messaging/faq

Rahil Ali
  • 957
  • 10
  • 25