FCM
updated 6 months ago
In this article:
One of the channels Engage supports for push notifications is Firebase Cloud Messaging (FCM).
How it Works
Engage connects to your Firebase account to send push notifications through broadcasts and automation to your customers. For this to work, the following requirements must have been met.
You have a Firebase account. You can follow this doc to create one.
You have integrated your Firebase account with Engage. You can do this via your Engage dashboard → Settings → Integrations → FCM.
You are tracking your users’ device token and device platform. The device token is how Engage is able to deliver the push notification to the targeted recipient through FCM. More on this later.
Integration Steps
Log in to your Engage account and visit the Settings page.
Click on the Integrations tab.
Click on the Connect button for Firebase. You will be directed to a page to upload your FCM key.
Log in to Firebase and Generate a new private key by creating a new project - Service Accounts.
Download the new key created.
Upload the file on Engage.
How to track device token and platform
As already mentioned, to be able to send push notifications, you need to track the customer's device token and platform. Engage allows you to track up to 5 device tokens per customer.
Before you can send the device token and platform to Engage, you need to get the token from the user’s device. The token is also generally referred to as registration token. FCM provides an easy way to get this within the mobile application. Here is how across some development platforms:
Once you get the device token, the next step is to send this to Engage. There are different ways to do this depending on how you integrate Engage with your mobile application or game.
If you are using the Engage User API, you can send the parameters
device_token
anddevice_platform
when creating a customer or updating the customer’s attributes.If you are using the Flutter SDK, you can use the
setDeviceToken
method. More details in the documentation.If you are using the Android SDK, you can use the
setDeviceToken
method. More details in the documentation.If you are using the Segment integration, ensure you are sending the device token to Segment. Using the Segment Android library, you can do this via
putDeviceToken
. For iOS, you can do this withregisteredForRemoteNotifications
.
An example of tracked device token and platform can be seen below.

Was this article helpful?