Skip to main content

Push Notification Providers

MessagePipe currently supports Firebase Cloud Messaging (FCM) for push notifications across Android, iOS and Web. Additional providers including OneSignal and APNs are coming soon.

Setup Overview

  1. Create a push config for your project
  2. Add FCM as a provider with your Firebase service account credentials
  3. Integrate the required APIs and start sending push notifications

Push Config

Create Push Config

POST /push-config?projectId={projectId}
Content-Type: application/json
Authorization: Bearer your-jwt-token
{
"enabled": true
}

enabled defaults to true if omitted. Only one push config can exist per project.

Get Push Config

GET /push-config?projectId={projectId}
Authorization: Bearer your-jwt-token

Update Push Config

PUT /push-config?projectId={projectId}
Content-Type: application/json
Authorization: Bearer your-jwt-token
{
"enabled": false
}

Managing Providers

Add a Provider

POST /push-config/providers?projectId={projectId}
Content-Type: application/json
Authorization: Bearer your-jwt-token
{
"provider": "fcm",
"name": "My FCM Provider",
"priority": 1,
"enabled": true,
"config": {
"projectId": "your-firebase-project-id",
"clientEmail": "firebase-adminsdk-xxx@your-project.iam.gserviceaccount.com",
"privateKey": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
}
}
FieldRequiredDescription
providerYesProvider type. Currently only fcm
nameYesCustom label for the provider instance
priorityYesFailover priority (lower number = higher priority)
enabledNoDefaults to true
configYesProvider credentials (see below)

FCM Configuration

Obtain these values from your Firebase console under Project Settings → Service Accounts → Generate new private key:

FieldDescription
projectIdYour Firebase project ID
clientEmailService account email
privateKeyFull private key including BEGIN/END markers

Get All Providers

GET /push-config/providers?projectId={projectId}
Authorization: Bearer your-jwt-token

Update a Provider

PUT /push-config/providers/{providerConfigId}
Content-Type: application/json
Authorization: Bearer your-jwt-token

provider type cannot be changed after creation. All other fields are optional.

Delete a Provider

DELETE /push-config/providers/{providerConfigId}
Authorization: Bearer your-jwt-token

Update Provider Priorities in Bulk

PUT /push-config/providers/priorities?projectId={projectId}
Content-Type: application/json
Authorization: Bearer your-jwt-token
{
"providers": [
{ "id": "provider-uuid-1", "priority": 1 },
{ "id": "provider-uuid-2", "priority": 2 }
]
}

Provider Schemas

Fetch the required config fields for any supported provider:

GET /push-config/provider-schemas
Authorization: Bearer your-jwt-token

For a specific provider:

GET /push-config/provider-schemas/fcm
Authorization: Bearer your-jwt-token