0

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.

anhlt
  • 384
  • 1
  • 4
  • 11
  • @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 Sep 30 '16 at 05:12
  • 1
    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. Sep 30 '16 at 05:17
  • 1
    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 Sep 30 '16 at 05:17
  • @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 message – anhlt Sep 30 '16 at 05:20
  • are you sure GCM and FCM has different formats for tokens ? – Developine Sep 30 '16 at 05:54
  • @anhlt Do make sure that you are using the corresponding Sender ID. See the [docs](https://firebase.google.com/docs/cloud-messaging/http-server-ref#error-codes). Also, do edit your post in order for others to provide you a more appropriate answer. Providing as much details as you have. – AL. Sep 30 '16 at 06:12

1 Answers1

1

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.

anhlt
  • 384
  • 1
  • 4
  • 11