targeting "following" \ "followers" with push notifications.

Hi dear Backendlesses!
how do I send a push notification to the people who follow the user ?

each user has a “one to many” property with the emails of the followers. I need to send the push to them. but I have no clue how to do it with the logic of sending and receiving the push notifications in Backendless.
I’ve registered each user to a channel named like own email:


Messaging.DEVICE_ID = user.getEmail();
Backendless.Messaging.registerDevice(gcmSenderID, user.getEmail() ,new AsyncCallback<Void>() {and I need to somehow send the push to the list of people following the user…
I’m sure that it’s now a good practice to do a ‘for’ loop sending to each one by mail address.
please help.
Gil.

help?

Is your question how to send push notification to specific recipients?

Hi Mark,

My question is how to send push notifications to all the users in a “one to many” relations property.

thank you.

Hi Gil,

You need to know deviceId for each user. That information must be stored somewhere in your application (possible in a data table).

Regards,
Mark

Hi Mark,

I will divide the question into two parts:

  1. what is the way in Backendless to send a push notification based on a "one to many’ property ? something like this:
    Backendless.Messaging.publish(user.getproperty(“Followers”), user.getProperty(“moodwhy”), new AsyncCallback<MessageStatus>() {

  2. what if the user uses the app on both his tablet and phone … ? the only common thing will be the user ID, not the device ID. can’t we register the app and not the device ?

thanks.

  1. to send a push notification to a specific device, you need to use the “singleCast” option in the DeliveryOptions class.

  2. If a user uses table and phone, then each device will have its own deviceId and you can send push notification to both.

Regards,
Mark