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
All you need is an installation query, along with an accompanying push. For example:
var pushQuery = new Parse.Query(Parse.Installation);
pushQuery.containedIn("user", userlist);
Parse.Push.send({
where: pushQuery,
data: {
alert: "Your push message here!"
}
}, {
success: function() {
response.success("pushed");
}, error: function(error) {
reponse.error("didn't push");
}
});
That installation query can be a query based on a channel, and there are other specifications you can make for the push query, given in the documentation:
Parse Docs