Nissar
Nissar

Reputation: 2480

Where can I find the API KEY for Firebase Cloud Messaging?

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

Answers (14)

Bob Hassan
Bob Hassan

Reputation: 1

inside google-service.json file look up current_key

Upvotes: 0

Dawood's signature
Dawood's signature

Reputation: 141

There are two primary ways to locate your Firebase API key:

Check the Project Settings:

  • Navigate to the Project Settings section of your Firebase console.
  • Click on the General tab.
  • Look for the Web API Key field. Your APIkey should be displayed there, starting with "ALZa*********** enter image description here

Access from Service Accounts:

  • If the API key isn't visible in the General tab, proceed to the Service Accounts section within Project Settings. enter image description here

  • Under the All service accounts section, you will see number of service accounts click on that. enter image description here

  • A new page of the IAM & Admin will appeared.

  • click on search bar and type the API key. enter image description here

  • Click on the Credentials option. enter image description here

  • Select Show key to reveal your API key. enter image description here

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

Harshal Pudale
Harshal Pudale

Reputation: 278

If you want to get the current api key programmatically in android studio, use

 FirebaseOptions.fromResource(context).getApiKey()

Upvotes: 0

Noor Mohammad
Noor Mohammad

Reputation: 39

  1. Click on Project Overview -> Project Settings,
  2. Then click on Cloud Messaging,
  3. 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

Upvotes: 3

Prageeth godage
Prageeth godage

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

Sehrish Waheed
Sehrish Waheed

Reputation: 1565

  1. Click on Project Overview -> Project Settings
  2. Copy your web api keyGet you web api key

Upvotes: 0

Vimal Swaroop J
Vimal Swaroop J

Reputation: 193

You can find API KEY from the google-services.json file

Upvotes: 4

lalit kumar Mehta
lalit kumar Mehta

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.

enter image description here

Upvotes: 13

norbert chitsike
norbert chitsike

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

Bruno Giubilei
Bruno Giubilei

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:

  • apiKey
  • authDomain
  • databaseURL
  • storageBucket
  • messagingSenderId

Upvotes: 13

Devpushp Ohri
Devpushp Ohri

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

Shaktisinh Jadeja
Shaktisinh Jadeja

Reputation: 1467

STEP 1: Go to Firebase Console

STEP 2: Select your Project

STEP 3: Click on Settings icon and select Project Settings

Select Project Setting

STEP 4: Select CLOUD MESSAGING tab

enter image description here

Upvotes: 77

Diego Giorgini
Diego Giorgini

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

Victor Le
Victor Le

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.

  • 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

Upvotes: 4

Related Questions