0
votes

I'm migrating my Android application from Parse to Firebase. Everything work very well when user install my app for the first time, however, for the user who upgrade from old version using GCM(Parse), I always get the old GCM token format like

String refreshedToken = FirebaseInstanceId.getInstance().getToken();
# APA91bG66...

New installs always get something like

String refreshedToken = FirebaseInstanceId.getInstance().getToken();
# c7TUtBlvNqk:APA91bHMDU

How can I force Firebase to return the new format?

[Edit] As I mention before, I upgrade from Parse. In order to keep both of them working well, in this version I have to retain GCM(Parse) and integrate FCM. I still initial Parse Service to get installation, which use the other GCM application. So I think the token I get from FCM belong to the other GCM application. I'm investigating it.

1
@AL. I know it, but when I install from scratch , I got something like fuQpt-ovvdY:APA91bHn_.... and I can send message flawlessly . But If I upgrade from old version, I got something like APA91bG66..... And When I send message, I got Error : "error": "MismatchSenderId"anhlt
MismatchSenderId means that you are using a token that is meant for a different project (other than the one you are using to send a notification). If that is your main concern, I think your post is a little bit different..AL.
As pointed by @AL. your firebase sender id on client side is mismatched. That means that you would required your old GCM clients to uninstall and install new version. Or maybe you are using old server key on server side.Rushi M Thakker
@Al. Do you have any advise , new installs works well, and it just happen when I upgrade from old version , which use Parse to send messageanhlt
are you sure GCM and FCM has different formats for tokens ?Developine

1 Answers

1
votes

My fault! I have to use the same google project that I use before.

Remember to import Google API project to Firebase, Not create the new one.