I want to send a Push Notification with Cloudcode on Parse.com.
The push notification should be sent to all android devices that are subscribed to a specific channe
1) Add
Parse.initialize("APPLICATION_ID", "JAVASCRIPT_KEY");
2) Enable Java scripts push notification in Parse.com
3) Download Java script project "parse-js-blank"
4) Create installation object with Channel
5) send request.
Parse.Push.send({
channels: [ "Giants","Vaquar" ],
data: {
alert: "Vaquar Alert Message."
}
}, {
success: function() {
// Push was successful
},
error: function(error) {
// Handle error
alert("(error"+eval(error));
}
});
Reference: https://parse.com/docs/js/guide#push-notifications