Start a new topic

How to send push notification to specific users not all the users?

Hi,



I am working on a android application and i want to send push notification to some selected users from database using Business logic on postSave.

I do not want to send push notifications to all the users.


How can i implement this??




1 person has this question

Thanx Damien Bell

No worries, please let me know if you need anything else.

Sukhpal,


You could do something like the code below


 

function onPostSave(request, response, modules) {
 var push = modules.push;
 var collectionAccess = modules.collectionAccess;
 
collectionAccess.collection('user').find({'username': 'bc18fbae-708b-416e-a47e-ae96f7d1ecfe'}, function (err, user) {

   push.sendMessage(user, 'hello3a');
   response.continue();
});
 
}

 There may be a stray ) or } in there, but that is roughly right.


Thanks.

hi damien,


plz answer me this question..


https://support.kinvey.com/support/discussions/topics/5000051310

I am unable to send push notification ... i have only one user in user collection .. i managed My users creating my custom user collection named "LoginMaster". please open the above link i posted and study all the code and answer me. 


Login or Signup to post a comment