Prerequisites
Setup
Open the in Courier and enable it. The integration needs no credentials, because Courier delivers using the Expo push tokens on each recipient’s profile.Profile requirements
Device tokens live on the user profile rather than on the send, so one profile can hold tokens for several devices and every push provider reads them from the same place. covers the model. Expo addresses the device by Exponent push token, so the profile you send to needs anexpo object. Store the token once with , which merges into the profile and creates it if it does not exist:
- One device
- Several devices
Pass one device’s token as a string to
expo.token.If you pass both
token and tokens, Courier merges token into the tokens array and dedupes it.user_id and Courier resolves the address.
For a one-off with no stored profile, pass it inline instead: "to": { "expo": { "token": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]" } }.
Send by user id
The call in every language, and the rest of the profile object.
Send to a recipient
- Send to user id
- Send to a token
Courier reads
expo off the saved profile, so preferences apply and the value can change without touching this code.Overrides
covers the two levels and which one wins. lists the fields every push provider takes. A provider override changes what Courier sends to Expo’s API. Override keys apply at the top level of the Expo message, not nested underbody. This request adds a ttl and turns off the sound:
Tracking events
Courier includes tracking URL information in thedata attribute of the incoming message payload.
See
Troubleshooting
Could not find APNs credentials
Expo’s help forum explains how Expo handles APN tokens:Expo push tokens work quite similarly to how Apple’s tokens work with APN’s, since Expo’s server is a relatively thin service that relays notifications to Apple. Expo needs valid APN credentials to send push notifications. And as with APNs in general (not specific to Expo), it doesn’t matter what APNs credentials you had at the time an iOS device provided a device token - the APN credentials just need to be valid at the time of sending the notification.
So, if you revoke your APNs credentials or clear them from Expo, or if your APNs credentials expire (APN p12 certificates expire after one year), Apple will reject all of your push notifications until you provide Expo with valid APN credentials. To be clear, your Expo push tokens and the underlying iOS device tokens are still valid and will still work once you provide new, valid APN credentials.
In this case, the errorCould not find APNs credentials for…means that Expo does not have any copy of your APNs credentials (currently a p12 certificate). You will need to let Expo recreate the credentials for you (recommended in most cases: runexp build:ios -cto clear all of them and then runexp build:iosto let Expo re-provision them) or upload your own credentials from Apple’s developer center (be sure to follow the instructions carefully.
- Your push key should be correctly configured at
https://expo.dev/accounts/[account]/projects/[project]/credentials?platform=ios - You’ve correctly set your bundle identifier in your configuration
- If you are explicitly passing in the
experienceIdinNotifications.getExpoPushTokenAsync({ experienceId: 'xxxx' }), make sure it is in the format of@expo_account/expo_projectname
Provider details
routing.channels instead is supported, and sends through just this provider.
Send to a specific provider
When that is worth doing, and what you give up: failover, channel priority, and providers you add later.