Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Expo = require('expo-server-sdk')
- const expo = new Expo()
- async function send(messages) {
- const chunks = expo.chunkPushNotifications(messages)
- for (const chunk of chunks) {
- try {
- const receipts = await expo.sendPushNotificationsAsync(chunk)
- receipts.forEach(receipt => {
- if (receipt.status === 'error') {
- throw new Error(receipt.message)
- }
- })
- } catch (error) { ... }
- }
- }
Add Comment
Please, Sign In to add comment