Firebase Cloud Messaging
| Schemes | fcm:// |
| Cargo feature | service-fcm |
| Service | https://firebase.google.com |
| Body formats | text (first is the default) |
| Attachments | no |
| Title length | 250 characters |
| Body length | 1,024 characters |
| Body lines | unlimited |
| Request throttle | none |
| Vendor URLs accepted | no |
URL formats
{schema}://{project}/{targets}?keyfile={keyfile}
{schema} is one of fcm://.
URL tokens
| Token | Meaning | Type | Required | Default | Notes |
|---|---|---|---|---|---|
{keyfile} | OAuth2 KeyFile | string | yes | secret | |
{project} | Project ID | string | no | ||
{target_device} | Target Device | string | no | ||
{target_topic} | Target Topic | string | no | prefix # | |
{targets} | Targets | list | yes | any of target_device, target_topic; separated by / |
Query parameters
| Parameter | Meaning | Type | Default | Notes |
|---|---|---|---|---|
color | Notification Color | string | no | |
image | Include Image | bool | no (usually; depends on the URL) | |
image_url | Custom Image URL | string | ||
mode | Mode | choice | oauth2 | one of oauth2; legacy is rejected: that API was shut down in July 2024 |
priority | Mode | choice | one of min, low, normal, high, max | |
to | Targets | list | sets {targets} |
Prefixed parameters:
+name=value: Data Entries
The common URL parameters (format, overflow, verify, redirect, cto, rto, retry, wait, store, tag, tz, user, password, port, optional, emojis) apply as well.
Examples
Rejected URLs:
fcm://
fcm://:@/
fcm://project@%20%20/
fcm://apikey/device
Notes
Firebase Cloud Messaging (fcm://).
Reads a service account JSON key file, signs an RS256 JWT assertion, trades it for an access token and sends through the HTTP v1 API. The legacy API (server keys, fcm/send) was shut down in July 2024: URLs without a key file are rejected. So are URLs with ?mode=legacy.
Differences with Apprise
- The key file must be local (a path or
file://); only RSA service account keys are supported (Apprise fails on others as well). - Legacy mode (server API key,
fcm/send) defaults on in Apprise when no key file is given, while mercurio rejects such URLs and?mode=legacy: Google shut that API down in July 2024. Only the HTTP v1 API is used.