Skip to content
Last updated

Firebase Cloud Messaging Streaming Output Integration

Firebase Cloud Messaging (FCM) is cross-platform messaging solution that allows to reliably send messages.

With this integration you can send messages to the channels such as email, SMS or Line with real-time trigger activations

Prerequisites

  • Basic knowledge of Treasure Data
  • Basic knowledge of FCM, including knowledge project, app in FCM website features
  • Login credentials for your Firebase Cloud Messaging account

Use Cases

The primary use case for this streaming integration is to incorporate it into a real-time activation workflow to:

  • Trigger a message delivery to FCM

Here is an overview of how to configure that workflow to trigger a delivery:

  1. On the FCM website, learn about how to create a project Firebase Project features necessary to send messages.
  2. On the FCM console, select your project and create a new app according to your platform.
  3. On the FCM console, select your app and go to app configuration. Get the app config as google-services.json in JSON format.
  4. Create an authentication for this integration to communicate with Firebase Cloud Messaging.
  5. In a Real-time Journey, select this authentication for a new triggered activation.

Requirements and Limitations

Static IP Address of Treasure Data Integration

If your security policy requires IP whitelisting, you must add Treasure Data's IP addresses to your allowlist to ensure a successful connection.

Please find the complete list of static IP addresses, organized by region, at the following document

Firebase Cloud Messaging Streaming Export via Treasure Console

You must create and configure the data connection in Treasure Data. As part of the data connection, you provide authentication credentials to access the integration.

Create Authentication

Perform the following steps to create a new authentication with a set of credentials.

  1. Select Integrations Hub.
  2. Select Catalog.
  3. Search for your Integration in the Catalog; hover your mouse over the icon and select Create Authentication. Firebase Cloud Messaging connector tile in the Integrations Hub Catalog Create Authentication button displayed when hovering over the Firebase Cloud Messaging connector
  4. Ensure that the Credentials tab is selected and then enter credential information for the integration.

New Authentication Fields

Authentication configuration screen showing the Private Key In JSON File field

ParameterDescription
Private Key In JSON FileThe JSON credential of the App in Project
  1. Select Continue.
  2. Enter a name for your connection.
  3. Select Done.

After configuring the Firebase Cloud Messaging Streaming integration, it is now available to be incorporated into real-time customer journey activations. See Creating a Real-time Triggered Activation for additional information.

Real-time Triggered Activation

To create or update a triggered activation:

  1. Select the triggered activation you want to configure .

  1. In the triggered activation window, select an activation from the Copy triggered activation from drop-down menu.
  2. Enter a Triggered activation name.
  3. Enter an Optional description of the activation.
  4. From the Authentication drop-down menu, select the authentication the activation should use.

Depending on the type of authentication you choose, the details you will need to provide will vary. Refer to the integration-specific table below for more information.

Firebase Cloud Messaging Output Streaming Activation Config

  1. Verify or provide the information required for the fields on the Details page.
  2. After the Details are configured, select Create or Update.

Integration Parameters

ParameterValuesDescription
Namerequired - StringThe identifier of the message sent, in the format of projects/*/messages/{message_id}.
TargetToken - Topic - Condition, default TokenWe will support multiple targets, as provided by the Firebase platform: Token, Topic, Condition
Datarequired - JSONThe Data will be sent with the message. Arbitrary key/value payload, which must be UTF-8 encoded.
NotificationrequiredThe notification payload to be sent with the message.
AndroidoptionalThe Android-specific options for the message.
APNsoptionalApple Push Notification service options for the message
FCM OptionsoptionalFCM options for the message
Maximum Number Of Retryoptional, default 3Number of retries before it gives up.
Initial Retry Delayoptional, default -2How long wait before retrying the first one
Retry Delay Multipleoptional, default 2The factor to multiply the delay after each retry

Union field target. Required. Input only. Target to send a message to. target can be only one of the following:

TargetTypeDescription
TokenstringRegistration token to send a message to.
TopicstringTopic name to send a message to, e.g. "weather". Note: "/topics/" prefix should not be provided.
ConditionstringCondition to send a message to, e.g. "'foo' in topics && 'bar' in topics".

Retry and Logging Logic

  • The connector will retry to send the request when it gets the status code 429, 500, 502, 503, or 504.
  • If the request is sent successfully before the Maximum Number of Retry is reached, the logging will show successfully.
  • If the request still fails after reaching the Maximum Number of Retry, the connector will stop the job.
  • We will see the error message and the status code in the client's activation table whenever the request sent fails.
  • The Maximum Number of Retry can be configured in the Activation Config.