Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Cloud Messaging different keys

Whats is the current key generated in google_services.json file when making the project. What is the difference between current key, web API key, and server key, and where can I find current key FCM console? I cannot find it.

like image 949
JSONParser Avatar asked Nov 01 '16 10:11

JSONParser


1 Answers

There is no documentation as of the moment that clearly discusses what values are found in the google-services.json file. Although this answer pretty much gives you an idea on what it is and what it does.

As for the specific details you were asking for:

  • current key - nothing is explicitly stated anywhere in the docs where it is used, however, among the 3 services where the google-services.json was originally used for before Firebase (Google Sign-in, Analytics, GCM), I'm guessing it would be between Google Sign-in and Analytics. As also mentioned by @DiegoGiorgini here:

The api_key value in google-services.json is not used by FCM. (it is used by other Firebase libraries)

So it can be for a separate Google non-Firebase or Firebase service.

  • Web API Key - this one I haven't had a chance to use before. However, I've seen other posts wherein this specific API key is used often on Web apps related to Firebase (possibly also for Auth purposes?), but I'm not entirely sure.

  • Server Key - as per the docs:

A server key that authorizes your app server for access to Google services, including sending messages via Firebase Cloud Messaging.

I also tried to look around the Firebase Console on where the current key is visible, but it doesn't seem to be there.

like image 156
AL. Avatar answered Oct 10 '22 17:10

AL.