Reputation: 177
I made an app that wants to blast (thousand users) notification using expo-notifications, like expo docs said https://docs.expo.io/push-notifications/sending-notifications/#http2-api, I send POST request to https://exp.host/--/api/v2/push/send
, but when I tried to implement it on the server, it takes minutes to process it, because there are too many FCM token in the database. The reason why I didn't use some SDK like on the link before because my BackEnd used languages that not listed on the expo docs. How can I achieve that?
Upvotes: 0
Views: 627
Reputation: 471
There are multiple things you can ensure you're doing to be sure you're sending the notification requests the right way.
to
argument as an array containing multiple tokens instead of firing multiple HTTP requests to the same endpoint? Sending thousands of HTTP requests instead of one with multiple tokens may take significantly more time to finish.This can greatly reduce the amount of upload bandwidth needed to send large numbers of notifications.
As far as I know:
exp.host/…/send
doesn't actually wait for the notification to be sent, it's only a "put the notification on the queue", so there's no reason for the request to take any long time.Another question I'd have is what language, library are you using on your backend and how are you sending the request to the Expo servers? Maybe there's some problem?
Upvotes: 0