How to get Project Number and API Key for GCM?

Update: Google has now started using Firebase Cloud Messaging for Web Push, this post is now outdated. You can see how to get the FCM ID and key from our documentation here. However, if you had used your own GCM configuration with us, there is no need to change that, it is still applicable.

Chrome currently uses Google Cloud Messaging (GCM) for web push notifications. By default we use our own GCM account for notifications, it means your subscribers will be associated with our account. If you don’t have your own GCM account to work with, you won’t be able to export your subscriber list.

To get a GCM (Google Cloud Messaging) API key, you have to follow these steps:

Create a project

  1. First go to the Google Developer Console. Then you have to accept the terms of service. Once done, in the top left you will see “Project” option. Click on it and select “Create project”.
  2. A dialog will appear, mention the Project name in the text box and click on “Create”. Be patient, this will take some time.
  3. Now, to get the Project Number, click on the “3-dots menu” at the top right and choose “Project settings”. A page will open up, just copy the Project Number and paste it into the PushAlert Dashboard.

 

GCM API Key

  1. Now, head over to the sidebar, click on the overview menu and select “API Manager”. Then click on Dashboard, followed by “Enable API” on the right.gcm-enable-api
  2. Once done, search for “google cloud messaging” in the text box and click on it. You will be redirected to Google Cloud Messaging overview page, and then just click on “Enable” at the top.
  3. Go to “Credentials” tab available in left sidebar. Now you will get one of the two options, either “Add credentials to your project” where you have to click on API key in the first step or “Create credentials”, where you have to select API key option from a drop down menu.
  4. You will get the API Key directly with no restrictions applied, and if you are given the option to choose any restrictions just select “None”, type in a name and then press the “Create” button.
  5. Copy and paste the API key into PushAlert dashboard.

That’s it.

Mohit Kuldeep