How can we help?

Configure Firebase Cloud Messaging (FCM)

Overview

Firebase Cloud Messaging (FCM) is Google’s messaging and notifications service that allows you to integrate push notifications in your apps, similar to the Apple Push Notification Service for iOS.

Message requests sent to FCM need to be authorized before they're routed to your apps—and eventually to your contacts’ devices. FCM can handle service account authentication by validating a project-specific JSON key file or server key. Cordial requires the JSON key file or server key for the project that contains your app in order to set up proper authentication channels with FCM servers.

If you're an Android developer, you likely already have a FCM account with an active project and apps. This is a prerequisite for setting up Android push notifications using Cordial's SDK.

Configure Cordial to access your FCM data

There are two ways give Cordial authentication to access your FCM account:

Key file authentication

Key file authentication requires you to create a service account in Google Cloud Platform, give the service account access to your FCM data, download a JSON key file, and upload it to Cordial.

Create a Google Service account

Before you can enable the integration, you must first create a Google Service account in Google Cloud Platform. 

1. Log in to your FCM account and open your project.

2. From the FCM console, navigate to Project Overview > Project Settings

3. In your Google Cloud IAM & Admin panel, navigate to Service accounts, give the account a name and an ID, and then click Create.

4. Enter a service account name, ID, and description and click Create and continue.

5. Click the Role dropdown and select Firebase Cloud Messaging API Admin.

Make sure to select Firebase Cloud Messaging API Admin, not Firebase Cloud Messaging Admin.

Generate JSON credentials

Once you've created your FCM service account, you can generate the JSON key file.

1. From your FCM service account, click the ellipsis (...) under Actions and select Manage keys

2. Select Add Key > Create new key.

3. Select the JSON radio button and click Create to download a JSON key.

3. Upload your JSON key in Cordial.

Server key authentication

1. Log in to your FCM account and open your project.

2. Navigate to Project Overview > Project Settings

3. Navigate to the Cloud messaging tab to access your server key.

4. Follow the steps below to enter your FCM server key into Android Sending Credentials.

Authenticate in Cordial

1. In Cordial, navigate to Settings > Account Transports.

2. Choose the mobile app transport that you are going to edit.

3. Click the Edit button in the Android Sending Credentials pane.

4. Enter your FCM server key and upload your Firebase service account JSON key.

Comments

0 comments

Please sign in to leave a comment.