Skip to content Skip to sidebar Skip to footer

Firebase: Can I Detect If A Server Api Key Is Fcm Or Gcm?

I have a mix of GCM and FCM Server API keys that belong to different android apps. However I am not the owner of the apps and do not have direct access to the google developer cons

Solution 1:

There is no way to tell if a Server Key used in the request is from a GCM/FCM enabled project. There is RemoteMessage.getFrom() which gives the Sender ID of the sender or to identify which topic the message was sent to, but it doesn't give any other details.

While on the matter, I'm fairly sure that there is even no way for you to retrieve the value of the Server Key that was used by the Sender in the first place.

With all that said, so long as it is a valid Server Key, it should be compatible to use for both GCM and FCM. From what I've experienced, I had a Server Key originally generated from my Developer Console, and after I imported the project to Firebase, the Server Key that appeared in the Cloud Messaging tab was still the same (I'm not so sure if that's still the case though).

Nonetheless, Server Key used for GCM should still be compatible for FCM.

Post a Comment for "Firebase: Can I Detect If A Server Api Key Is Fcm Or Gcm?"