When does Expo actually deliver a push notification to the app?
When you send a push notification through Expo's service your notification actually isn't delivered right away. It jumps through a few necessary hoops on its way to your app. I've summarized the journey a notification will take before finally making the trip to your user's device.
- Something happens in your app that triggers a push notification, for example maybe a user sends a message to another user.
- After creating the notification data, you send it to Expo's servers at
a. Expo rejects the notification and responds with an error message.
b. Expo accepts the notification and responds with a push ticket (you should save it for later).
- Now that Expo has the push notification info it'll send it off to Apple/Google.
a. Apple/Google rejects it for some reason and responds to Expo with an error message.
b. Apple/Google accepts the push notification and responds to Expo with an OK.
- Expo will update the push ticket with either the success or failure response from Apple/Google.
Depending on how heavy the load is this can take up to 30 minutes, but it's usually faster than that.
- After some time, say ~15-30 minutes, you should use the push ticket you received to verify that your notification was delivered by requesting the push ticket receipt at
a. If everything is fine, you're done and you can remove your saved push ticket.
b. If something went wrong, the push ticket receipt will contain the error message from Apple/Google. Here are the error cases you should prepare to handle.
The receipts will disappear after ~24 hours, so make sure to check them before Expo cleans them out.
The important thing to remember here is that you need to check in with Expo to see if there was an issue with your push notification.
If you liked this you'll probably also be interested in understanding the limitations of Expo's push notification service. Like if it's possible to send thousands of notifications per day.