Skip to content

Instantly share code, notes, and snippets.

@pivanov
Created June 3, 2016 22:03
Show Gist options
  • Save pivanov/4a8c9edf74d99544ce0d7f5ca0e36445 to your computer and use it in GitHub Desktop.
Save pivanov/4a8c9edf74d99544ce0d7f5ca0e36445 to your computer and use it in GitHub Desktop.
ParseGround Push Notifications via Cloud Code
//Just for test
var query = new Parse.Query(Parse.Installation);
query.equalTo('channels', 'test-channel');
Parse.Cloud.define('push', function (request, response) {
Parse.Push.send(
{
where: query,
data: {
alert: 'Test Push Notifications',
badge: 1,
sound: 'default'
}
}, {
success: function() {
return response.success('OK');
},
error: function(error) {
return response.success(error);
},
useMasterKey: true
});
response.success('Done!');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment