Firebase FCM

Configuration Requirements

You can get your Service Account JSON by following these instructions. Paste the complete contents of the JSON file you download from Firebase into the configuration field.

Profile Requirements

To deliver a message to a recipient over Firebase FCM, Courier must be
provided the recipient's Firebase registration token. This token should be included in the recipient profile as firebaseToken.

// Recipient Profile
{
  "firebaseToken": "MTI2MjAwMzQ3OTMzQHByb2plY3RzLmdjbS5hbmFTeUIzcmNaTmtmbnFLZEZiOW1oekNCaVlwT1JEQTJKV1d0dw=="
}

Override

You can use a provider override to replace what we send to the Firebase FCM API. For example, you can provide optional data payload.

{
  "event": "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
  "recipient": "abc123",
  "profile": {
    "firebaseToken": "MTI2MjAwMzQ3OTMzQHByb2plY3RzLmdjbS5hbmFTeUIzcmNaTmtmbnFLZEZiOW1oekNCaVlwT1JEQTJKV1d0dw=="
  },
  "data": {
    "dataForPushMessage": true
  },
  "override": {
    "firebase-fcm": {
      "body": {
        "data": {
          "Nick": "Mario",
          "Room": "PortugalVSDenmark"
        }
      }
    }
  }
}

Everything inside of override.firebase-fcm.body will be merged into the Message object we send to the Firebase FCM API.

Tracking Events

Courier will include tracking URL information in the data attribute on the incoming message payload.

See Courier push notification tracking


Did this page help you?