0
votes

In Android App, I am migrating from GCM to FCM to send push notification.

Then I have a question.

After migration, Can I send push notification by old GCM token starting from APA・・・?

I think when I first open my app from the migration, onTokenRefresh method is not called.

So the token is still old GCM one.

If I cannot send notification by old GCM token, what is the best way to change token(from GCM to FCM token) when I first open my app from the migration?

1
An official documentation is already provided by google. Its pretty self explainatory. developers.google.com/cloud-messaging/android/…Gaurav Sarma

1 Answers

0
votes

As part of the migration to FCM you will be given a new sender ID token that you should use at the new endpoint.

On the client you need to extend FirebaseInstanceIdService and in there the onTokenRefresh() method will be called with the new token. You should send this token to your server in the same way as you did for GCM if you want to contact your clients individually.