0

I am trying to send push notifications to segment users in Android. Below is the code, it worked for few trials but now the same code send the push to everyone instead of the intended receiver (at the least that is what is shown on the dashboard). Anything I am doing wrong here?

ParseQuery pushQuery = ParseInstallation.getQuery();
pushQuery.whereEqualTo("user", ParseObject.createWithoutData("_User", mObject.get(position)));//receiver
ParsePush push = new ParsePush();
push.setQuery(pushQuery);
push.setMessage(alias +" followed you");
push.sendInBackground(); 

mObject.get(position) is where I get the objectId of the receiver in the installation class from and 'user' is a pointer to the _User class. Thanks

rici
  • 234,347
  • 28
  • 237
  • 341
saintjab
  • 1,626
  • 20
  • 31
  • Have you verified with logging or debugging that `mObject.get(position)` is returning something that matches a user? – nasch May 06 '15 at 17:29
  • Yes @Nasch, I have verified that and even hard-coded an objectId but to no avail. – saintjab May 06 '15 at 17:31
  • If the exact same code used to work correctly I don't know what the issue is. I would see if you can figure out whether the messages are actually going to everyone - I would not be 100% confident that the parse dashboard is giving you accurate information. – nasch May 06 '15 at 17:33
  • Its true but I am just testing the app so I may have to install it on some devices before I can verify that – saintjab May 06 '15 at 17:44
  • Yeah if you have at least a couple of devices, set up a test and see if they all get the push. – nasch May 06 '15 at 17:53

0 Answers0