Notifications functionality

Please provide the following:

  1. SDK Version: 44
  2. Platforms(Android/iOS/web/all): All

For all the examples I’ve seen with Notifications, it’s demoed with the current user receiving a notification. How would one configuring it so a notification is sent to all users when the trigger happens?

For example, if I have a marketplace app, and a user adds a product for sale, how would I notify the rest of the users that there’s a new product on the app?

To do this, you’d need to just loop through all of your users and send the notifications in batches or one by one. There isn’t a single method to send something to all your users right now.

Ok to clarify, do you mean loop through each user and hit their notification-token one by one via “scheduleNotificationAsync”?

The notifications are sent from your server using the HTTP/2 API. This doc shows how to send up to 100 notifications in a single HTTPS request. If you use the Node.js library (expo-server-sdk-node) that wraps the API, there’s a chunkPushNotifications() function that lets you pass all the recipients and their messages and once, and it splits those into 100-notification-requests for you.

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.