Skip to main content

Requirements

  • Your Firebase project ID
  • Service account JSON credentials
Aampe will essentially call the Firebase Cloud Messaging API on your behalf. Setting up Firebase Cloud Messages involves four steps:
  1. Enable the Cloud Messaging API
  2. Create a custom role for message creation
  3. Create a service account
  4. Generate a key
All the next steps assume that you start from your [Google Cloud Platform console] with your Firebase project selected.

Enable the Cloud Messaging API

  1. Type “Firebase Cloud Messaging API” in the Search products and resources textbox.
  2. Choose Firebase Cloud Messaging API from the list. 1 Cloud Message Api Pn
  3. Click on the blue Enable button. 2 Enable Pn

Create a Custom Role for Message Creation

A custom Role must be created in the system to allow Aampe to trigger notifications using the API because the default roles do not provide granular enough permissions.
  1. Type “Roles” in the Search products and resources textbox and select the Roles (IAM and Admin) option. This will take you to the Roles page. 3 Iam Pn
  2. Click on + CREATE ROLE
  3. Fill in the role Title, Description and ID according to your conventions. 4 Create Role Pn
  4. Click on +ADD PERMISSIONS
  5. In the window that opens, search for cloudmessaging.messages.create using the textbox to the right of the Filter and select the cloudmessaging.messages.create entry that appears. 5 Add Permissions Pn
  6. Tick the cloudmessaging.messages.create permission and click on ADD 6 Add Permissions Create Pn
  7. Once added, click on CREATE to complete the role creation. 7 Save Permissions Pn

Create a Service Account

  1. Type “Service accounts” in the Search products and resources textbox.
  2. Choose Service accounts (IAM and admin) from the list. This will take you to the service account page. 8 Service Account Pn
  3. Click on + CREATE SERVICE ACCOUNT 9 Service Account Form Pn
  4. Fill in the Service account name, ID and description according to your conventions. 10 Service Account Filled Out Pn
  5. Click on CREATE AND CONTINUE
  6. On the Grant this service account access to the project screen, click on the Select a role dropdown.
  7. Under Quick access > Custom, select the custom role you created in the previous step. 11 Select Custom Pn
  8. Click on + ADD ANOTHER ROLE and then on the Select a role dropdown.
  9. Type “Firebase Cloud Messaging Admin” in the box near the Filter.
  10. Select the suggested Firebase Cloud Messaging Admin role. 12 Messaging Admin Role Pn
  11. Click on DONE to complete the service account creation. 13 Done Pn

Generate a Key

This step assumes that you created a service account and assigned the “Firebase Cloud Messaging Admin” and custom message creation roles to it.
  1. In your “Service accounts” page, find the service account you created for Aampe and click on the three dots in the Actions column and select Manage keys 14 Generate Key Pn
  2. Click on ADD KEY and select Create new key 15 Copy Key Pn
  3. Select the JSON Key type and click on CREATE 16 Json Key Pn
  4. Your browser will download a .json file with the key needed by Aampe.
Congrats! Keep your json key secure and let your Aampe technical counterparts know it is ready. They will take it from here.