send notification from firebase console to old users with gcm tokens? - android

I have questions about migrating from gcm to fcm.
we are going to migrate from gcm to fcm. we have lots of users with gcm tokens and we have already sent them push notifications from onesignal panel. now when we migrate to fcm,what happens to old users with gcm tokens? I know if we force our users to update their android version to new version(the one with fcm) the new fcm token will be generated for users. but what if we don't want to force our users to update? Is it possible to send notification from firebase console to old users that have gcm tokens?
I have already done the migration procedure according to this link:
https://developers.google.com/cloud-messaging/android/android-migrate-fcm

I tried same but gcm people is not getting notification so i make 2 payload 1 for fcm and 1 for gcm and sending massage for both fcm and gcm at same time so i m getting gcm notification but you have to handle crash for gcm notification in fire-base app. means it will crash when you receive gcm notification on fcm but when fcm notification come it will diaplay

Related

Android APP migrates from GCM to FCM. Old GCM tokens do not work

The document from Google says:
GCM tokens retrieved via GoogleCloudMessaging.register() or
InstanceID.getToken() will continue to work in FCM without any
modification or renewal.
But when I update my APP to FCM. The old GCM token which stores in my Server does not work anymore. When I tried to send a push message, the Google Message server response the error message, not registered. Does anyone ran into the same problem?
Based from the documentation of GCM and FCM FAQ:
Will your existing GCM tokens and token handling still work?
Your GCM and FCM registration tokens are mutually interchangeable; you
can send to existing GCM tokens through the FCM HTTP server APIs. For
GCM and FCM token handling, remember:
If you store and send to specific tokens, be sure to implement the token refresh method to ensure your tokens are always up to date
iOS devs should avoid calling .getToken(authorizedEntity,scope) unless there is a need to enable multiple senders. Use
FirebaseInstanceId.getInstance().getToken() instead.

Sending notification to GCM registrations using FCM console

I tried sending notifications to GCM user using FCM console. But the notification delivered twice.
Is it possible to send notification to GCM registrations using FCM console.
Is there any way?

Migrating from GCM to FCM in Android App

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?
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.

Does existing user that not update the apps still get GCM notification after I migrate to FCM?

If I upgrade my android apps and server notification to FCM, then update it to playstore. Does old apps that not updated (because still use gcm) still get notification? Should I inform all of my user to mandatory update the apps?
Thanks
here is the reply from firebase-support#google.com :
Thanks for reaching out!
Unfortunately, you won't be able to use Firebase APIs to send a notification directly to a target client by using the old GCM registration tokens. Registration tokens are generated by using the combination of Sender ID and API key and if those ID which belongs to GCM is different from FCM project, It will likely throw the MismatchSenderId error (or other error listed in the doc).
Hope this helps.
and the answer is No, FCM can't send push notification to GCM client.

Firebase not working with GCM server

t-0: Someone has a server X that uses GCM to send notifications on certain events
t-1: I build my android app against server X and implement GCM. And it works great.
t-2: Firebase has a nice feature that lets you send notification from a console (similar to how Facebook's Parse used to work)
t-3: I change from GCM to FCM.
t-4: My android app can no longer receive notifications from server X
Now Firebase claims, and I quote
Updating these endpoints is not strictly required, as Google will
continue to support the existing GCM endpoints.
For the skeptics: I am working on two different git branches fcm and gcm. When I am on branch gcm notification works; but on fcm I cannot get notification from server X (but it works from the Console, yay!)
You'll have to continue using the old method you were using to send push notifications to GCM users and for the users who registers through FCM will only be able to receive push notifications through FCM or Firebase Notification console.
You can't send push notification to GCM registration tokens through FCM.

Categories

Resources