Firebase Cloud Messaging
Estimated setup time
1 hour
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:
- Enable the Cloud Messaging API
- Create a custom role for message creation
- Create a service account
- 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
- Type "Firebase Cloud Messaging API" in the Search products and resources textbox.
- Choose Firebase Cloud Messaging API from the list.

3. Click on the blue Enable button.

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.
- 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.

- Click on + CREATE ROLE
- Fill in the role Title, Description and ID according to your conventions.

- Click on +ADD PERMISSIONS
- 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.

6. Tick the `cloudmessaging.messages.create` permission and click on **ADD**

7. Once added, click on **CREATE** to complete the role creation.

Create a service account
- Type "Service accounts" in the Search products and resources textbox.
- Choose Service accounts (IAM and admin) from the list. This will take you to the service
account page.

3. Click on **+ CREATE SERVICE ACCOUNT**

4. Fill in the Service account name, ID and description according to your conventions.

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.

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.

11. Click on **DONE** to complete the service account creation.

This step assumes that you created a service account and assigned the "Firebase Cloud Messaging
Admin" and custom message creation roles to it.
Generate a key
- 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

- Click on ADD KEY and select Create new key

- Select the JSON Key type and click on CREATE

- Your browser will download a
.json
file with the key needed by Aampe.
You are done! All you need to do now is securely share your Project ID and JSON file with Aampe.
Updated 8 months ago