I am trying to figure out how the new version of GCM or Firebase Cloud Messaging works so I moved one of my projects to the new Firebase console, If I did not have the API KEY or I want to create a new one... where can I do it?

- 565,676
- 79
- 828
- 807

- 2,360
- 2
- 13
- 12
-
2You need API key only for the officially not supported languages. https://firebase.google.com/docs/libraries/ – Babu Sep 27 '16 at 08:55
12 Answers
It's in https://console.firebase.google.com/project/(your-project-id)/settings/cloudmessaging
You can find the API KEY in:
(gear-next-to-project-name) > Project Settings > Cloud Messaging
Server Key is the API key.

- 364
- 1
- 6
- 11

- 12,489
- 1
- 47
- 50
-
4Thanks, I am wondering what happen if the API KEY get compromised, how to reset it or create a new one.. – Nissar May 20 '16 at 13:56
-
3ps: a workaround to rotate the key consist in opening the firebase project from http://cloud.google.com > API manager > credentials – Diego Giorgini May 29 '16 at 18:16
-
11
-
-
3I think the Server Key is not the same as the Web API Key, some other answers in here show they are used for different pourposes. – Ariel Moraes Apr 25 '17 at 19:24
-
1
STEP 1: Go to Firebase Console
STEP 2: Select your Project
STEP 3: Click on Settings icon and select Project Settings
STEP 4: Select CLOUD MESSAGING tab

- 1,427
- 1
- 17
- 22
Enter here:
https: //console.firebase.google.com/project/your-project-name/overview
(replace your-project
with your project-name
)
and click in "Add firebase in your web app"(the red circle icon) this action show you a dialog with:
- apiKey
- authDomain
- databaseURL
- storageBucket
- messagingSenderId

- 606
- 6
- 22

- 187
- 2
- 5
-
here is example with screen shot : https://www.appypie.com/faqs/how-can-i-get-api-key-auth-domain-database-url-and-storage-bucket-from-my-firebase-account – Mayuri R Talaviya May 17 '18 at 11:03
You can open the project in the firebase, then you should click on the project overview, then goto project settings you will see the web API Key there.

- 147
- 1
- 4
1.Create a Firebase project in the Firebase console, if you don't already have one. If you already have an existing Google project associated with your app, click Import Google Project. Otherwise, click Create New Project.
2.Click settings and select Permissions.
3.Select Service accounts from the menu on the left.
4.Click Create service account.
- Enter a name for your service account.
- You can optionally customize the ID from the one automatically generated from the name.
- Select Furnish a new private key and leave the Key type as JSON.
- Leave Enable Google Apps Domain-wide Delegation unselected.
- Click Create.
This might be what you're looking for. This was in the tutorial on the site

- 1,758
- 3
- 17
- 25
-
This for the officially supported firebase SDKs. Where in the doc it says, Java and nodejs. – Babu Sep 27 '16 at 08:46
Please add new api key from Firebase -> Project Settings -> Cloud Messaging -> Legacy Server Key
to the workspace file i.e google-services.json

- 3,158
- 3
- 34
- 48

- 29
- 1
- Click on Project Overview -> Project Settings,
- Then click on Cloud Messaging,
- Then click on three dots to the right side of Cloud Messaging Api(Legacy) and enable it,click on, to view image
4. Come back to Project Overview -> Project Settings -> Cloud Messaging, here you will get the Server Key

- 29
- 2
If you want to get the current api key programmatically in android studio, use
FirebaseOptions.fromResource(context).getApiKey()

- 3,294
- 5
- 35
- 52

- 178
- 1
- 2
- 7
Once you just go to autherization section it will generate and also make sure enable legacy if need Web api key is not generated in firebase while creating a new project as stated on the documentation

- 4,054
- 3
- 29
- 45
You can also get the API key in the android studio. Switch to Project view in android then find the google-services.json. Scroll down and you will find the api_key

- 1
- 1
- 1