Expo Push Provider
You can setup Expo Push Provider to send push notification to your user's Android and iOS devices built using the Expo SDK.
Unique Identifier
Each provider is identified by a unique identifier. Unique identifier of Expo Push Provider is expo_push
Enabling Expo Push Provider
To enable Expo Push Provider, login to your Engagespot Console, goto Channels -> Mobile Push and enable Expo.
User Profile Requirement
Expo Push Provider uses the expo.tokens
array in your User's profile to send notifications to them. That means, you should update the expo.tokens
array in your User's profile whenever you generate a Expo Token in your mobile app.
{
"expo": {
"tokens": ["ExponentPushToken[BCfLKML-NGQht7bPi34tMsl]"]
}
}
You should use the PATCH
or PUT
method of the /profile
API (Read Docs) to add an Expo token to user's profile.
Please note that, when you create a new User, they won't have the expo
object or expo.tokens
array. You can pass your user's Expo Token via expo.token
property via PUT
request. When you add more tokens, we'll keep adding them to expo.tokens
array.
Example
This is how you can attach a new Expo Token to user's profile.
curl --location --request POST 'https://api.engagespot.co/v3/profile' \
--header 'X-ENGAGESPOT-API-KEY: YOUR_ENGAGESPOT_API_KEY' \
--header 'X-ENGAGESPOT-API-SECRET: YOUR_ENGAGESPOT_API_SECRET' \
--header 'Content-Type: application/json' \
--data-raw '{
"expo":{
"token":"ExponentPushToken[BCfLKML-NGQht7bPi34tMsl]"
}
}'
Expo Push Provider Configurations.
Expo Push Provider needs only one configuration, that is the SERVICE_ACCOUNT
Json.
Configuration | Description | Required |
---|---|---|
projectId | The project ID of your Expo project. | Yes |
authToken | The authentication token of your Expo project. | If expo secure mode is enabled |
Overriding Expo Configuration and Notification Data via API
Expo Push Provider allows you to override all the above configurations and data while sending a notification through Engagespot API, using the https://api.engagespot.co/v3/notifications
endpoint.
To override the configurations, you must supply them via override.expo
parameter of the above API. Within the override
parameter, you can supply any object that we'll directly pass to Expo API Body See doc.
By default your Engagespot notification's title
, message
parameters will be passed to Expo's title
, body
respectively, and also the custom data payload from your workflow trigger will be passed to the data
field.