I want to send a push notification from a cloud parsing code for a specific user. Therefore, I created a user section in the setup class of my parsing table, and I save the identifier of the user object there, so I can target the user by id and send push from the cloud code. https://www.dropbox.com/s/dvedyza4bz3z00j/userObjec.PNG?dl=0
From parse.com it is very simple to do, I did it like this, with the condition https://www.dropbox.com/s/1mb3pb2izb0jlj9/pushs.PNG?dl=0
But what I want to do is send a push notification when the user adds a new object to the class, which my class is "Ticket".
This class has ACL enabled. What I want to do is very simple to send push to the user who created the object via cloud code
Here is my cloud code
Parse.Cloud.afterSave("Ticket", function(request) { var pushQuery = new Parse.Query(Parse.Installation); Parse.Push.send({ where: pushQuery, data: { alert: "New Ticket Added", sound: "default" } },{ success: function(){ response.success('true'); }, error: function (error) { response.error(error); } }); });
This code sends push to all users.
Please, help
source share