Is it possible to send a dozen notifications a day to thousands of users? Are there any limits? Is it reliable? How can I tell if it's working?
For off-the-shelf React Native apps using Expo, the only option for push notifications is Expo's own Push Notifications API. Other options like OneSignal or Firebase Cloud Messaging (FCM) are off the table unless you eject from Expo and integrate their API:s yourself.
FCM is actually available and required for Expo on Android, but not for iOS (yet).
This limitation is a common reason people stay away from Expo or choose to eject and use the bare workflow. There aren't any officially documented limits on how high volume their service will handle, so it's hard to know what to expect.
How many push notifications can I send?
Sending 100,000 notifications per day is completely fine. That's 10 notifications per day to 10,000 users. Or 20 to 5000. Rule of thumb is:
- Less than 100k per day is easy-peasy.
- At more than 1 million per day, you might want to talk to the Expo team about it.
- At more than 1 million AT ONCE, you may need to eject and handle things with your own server or third-party service.
The Expo team have repeatedly stated that there are no artificial limits on the push notification service. In other words, it's unlimited. They do say that for unusually high volumes they might in the future add a paid plan but ensures that for most normal apps you won't have any issues sending as many notifications as you need.
If you send a lot of notifications at once, you're going to want to do it right, so keep reading.
Is it reliable? How can I tell if it's working?
In the summer of 2018, the Expo team published the blog post "Upcoming changes to the Expo push notification service". It outlines how they're improving the reliability of their push notification service so that it'll become even more stable, and what you should consider in order to make sure your users don't miss any notifications.
The main points from the article are:
- Instead of making 1000 requests to send 1000 notifications, send 100 notifications in 10 requests using the batch notification API.
- Some time after sending (~15 minutes), you should check your push receipts to make sure Apple/Google have accepted the notifications.
- When a push receipt contains the
DeviceNotRegisterederror, stop sending notifications using that Expo push token (ignoring this will in the worst case cause Apple/Google to get angry).
A lot of the mentioned things are automatically handled for you if you use the latest version of expo-server-sdk.