1

Let's say that i am building an app for a 5 location restaurant. The user would choose which restaurant that they will allow "push notifications" from. Is this possible? Is it possible to allow a specific segment of an app to send notifications to a specific segment of users?

thanks

1 Answer 1

3

The answer is yes, it is possible to send notifications to a subset of your users, both in iOS and android applications.

For both iOS and android, requests for push notifications are sent to Apple or Google servers requesting messages be sent to specific users. The application requesting these push notifications (which we call a 'push server' at my company) can, therefore, selectively send push notifications.

The only requirement, then, is that your push server be able to dynamically determine which users should receive a given notification. You would have to do the following:

  • When a user selects their restaurant preferences, make a (presumably asynchronous) call to your back-end, where these preferences will be stored (in a database table, for example).
  • When you are ready to send a push notification, query this data source to determine what subset of your users have elected to receive notifications from the appropriate restaurant
  • Loop through the list of users who are to receive a notification, retrieve the relevant push token for each user, and initiate the push request by sending a message to the appropriate server (i.e. Google / Apple)

Hope this helps!

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.