Created
June 3, 2016 22:03
-
-
Save pivanov/4a8c9edf74d99544ce0d7f5ca0e36445 to your computer and use it in GitHub Desktop.
ParseGround Push Notifications via Cloud Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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