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?
![](../../users/profiles/209103.webp)
- 418,229
- 62
- 649
- 645
![](../../users/profiles/3224729.webp)
- 2,052
- 2
- 10
- 12
-
1You need API key only for the officially not supported languages. https://firebase.google.com/docs/libraries/ – Babu Sep 27 '16 at 08:55
11 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.
![](../../users/profiles/5263294.webp)
- 354
- 1
- 7
- 11
![](../../users/profiles/613115.webp)
- 11,617
- 1
- 45
- 48
-
2Thanks, 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
-
2ps: 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
-
8
-
-
1I 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
-
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
![](../../users/profiles/1621789.webp)
- 1,201
- 1
- 15
- 21
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
![](../../users/profiles/3837015.webp)
- 460
- 4
- 14
![](../../users/profiles/5164632.webp)
- 91
- 1
- 4
-
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.
![](../../users/profiles/9097551.webp)
- 81
- 1
- 3
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
![](../../users/profiles/6318520.webp)
- 1,510
- 2
- 13
- 23
-
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
![](../../users/profiles/1079103.webp)
- 2,457
- 3
- 29
- 39
![](../../users/profiles/10434500.webp)
- 21
- 1
You can find your Firebase Web API Key in the follwing way .
Go To project overview -> general -> web API key
![](../../users/profiles/12793212.webp)
- 898
- 4
- 12
-
I am very thankful for those who promoted this answer, I made this answer as short as possible , so that you will save your time, and you can work on it. Please let me know If you have any suggestions – Rohan Devaki Aug 05 '20 at 06:43
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
If you want to get the current api key programmatically in android studio, use FirebaseOptions.fromResource(context).getApiKey()
admin should give you access to view the project settings, otherwise cloud messaging tab will be hidden on your console