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
You don't need a query to send a push to a channel. Just call Parse.Push.send and add a channel array to the data object.
Parse.Push.send({
channels: [ "channel_name" ],
data: {
alert: "Alert message"
}
}, {
success: function () {
response.success("Push was sent");
},
error: function (error) {
response.error("Could not send push " + error)
}
});
Be sure to not use spaces and Capital letters in channel names. The channel will not be added to the subscribed channels in the backend.