0

I want to get the GCM Browser Key in the Developer Console, but the latest Developer Console doesn'tshow the Browser Key selection.

If I click Credentials, it doesn't show anything apart from one single key. I don't know what is the procedure to get the Browser key.

If anyone knows let solve my problem. Thanks in Advance.

enter image description here

AL.
  • 36,815
  • 10
  • 142
  • 281
hem
  • 311
  • 1
  • 5
  • 16

2 Answers2

0

Update: There is now a visible note in the GCM docs saying:

Starting from Sept. 2016 new server key can only be created in the Firebase Console using the Cloud Messaging tab of the Settings panel. Existing projects that need to create a new server key can be imported in the Firebase console without affecting their existing configuration.


Update: It seems that using the Server Keys from the Firebase Console is the sure thing solution.

If you are just starting to use GCM, instead of creating a project in the Google Developers Console, do it in the Firebase Console. After creating the project, simply use the auto-generated Server Key. Here are the steps where to find the Server Key:

  1. Go to your Firebase Console and click on CREATE NEW PROJECT.
  2. Fill in your desired Project Name and select your Country. After this, the new Project should be active.
  3. Then on left-side panel, click on the gear button and select Project Settings.
  4. Then go to the Cloud-Messaging Tab.

For old GCM projects, you can simply Import the project to the Firebase Console:

  1. Go to your Firebase Console and click on IMPORT PROJECT.
  2. Select the project you want to import and your country.
  3. Click on ADD FIREBASE. After this, the new Project should be active.
  4. Then on left-side panel, click on the gear button and select Project Settings.
  5. Then go to the Cloud-Messaging Tab.

Basing from the image, you've already generated an API Key. But gonna include the steps for visibility:

  1. Go to your Google Developers Console
  2. On the left-pane, click on Credentials
  3. Under the Credentials Tab, Click on Create Credentials
  4. Select API Key

With that, the API Key is already available. However, it will default as a No Restriction key. You may click on Restrict Key to add the restriction corresponding to what you need the API Key for.


I'm not entirely sure, but for a Browser Key, I think you would need to set the HTTP referrers (web sites) restriction. Since basing from the other restrictions:

  • IP addresses (web servers, cron jobs, etc.) = Server Key
  • Android apps = Android Key
  • iOS apps = iOS Key

You may try the API Key generated without any restrictions, however, it is highly encouraged for you to add the corresponding restriction as a security measure against unauthorized usage and quota theft.

AL.
  • 36,815
  • 10
  • 142
  • 281
0

You need to go to Google Developer Console and follow this steps:

  1. Create Project
  2. Enable Library
  3. Create Credential (*)

(*) when u create credential, click on Restrict Key and add your specific Key restriction.

Marco Ferretti
  • 149
  • 1
  • 2
  • 12