Reputation: 2480
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?
Upvotes: 204
Views: 320818
Reputation: 141
There are two primary ways to locate your Firebase API key:
Check the Project Settings:
Access from Service Accounts:
If the API key isn't visible in the General tab, proceed to the Service Accounts
section within Project Settings.
Under the All service accounts section, you will see number of service accounts
click on that.
A new page of the IAM & Admin will appeared.
Key Points:
The API key is crucial for interacting with Firebase services from your application. Treat your API key with confidentiality, as it grants access to your Firebase project. If you encounter any difficulties locating your API key, refer to the official Firebase documentation for detailed guidance.
Upvotes: 11
Reputation: 278
If you want to get the current api key programmatically in android studio, use
FirebaseOptions.fromResource(context).getApiKey()
Upvotes: 0
Reputation: 39
4. Come back to Project Overview -> Project Settings -> Cloud Messaging, here you will get the Server Key
Upvotes: 3
Reputation: 4574
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
Upvotes: -1
Reputation: 1565
Upvotes: 0
Reputation: 167
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.
Upvotes: 13
Reputation: 11
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
Upvotes: -1
Reputation: 327
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:
Upvotes: 13
Reputation: 39
Please add new api key from Firebase -> Project Settings -> Cloud Messaging -> Legacy Server Key
to the workspace file i.e google-services.json
Upvotes: 3
Reputation: 1467
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
Upvotes: 77
Reputation: 12717
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.
Upvotes: 373
Reputation: 1788
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.
This might be what you're looking for. This was in the tutorial on the site
Upvotes: 4