Сейчас я нахожусь на новом сервере с открытым исходным кодом и пытаюсь отправить push-уведомление с помощью облака main.js
. Я отправил push с помощью curl, но не могу в файле .js. Вот код, который у меня есть.
Parse.Cloud.define("PushNotification", function(request, response) {
console.log('sending push');
var Installation = new Parse.Query(Parse.Installation);
console.log(Installation);
Parse.Push.send({
where: Installation,
data: {
alert: request.params.Message,
badge: 0,
sound: 'default'
}
}, {
useMasterKey: true,
success: function() {
// Push sent!
console.log('Push sent');
response.success('success');
},
error: function(error) {
// There was a problem :(
response.error("Error push did not send");
console.log('sending push error: '+error);
}
});
Пишет, что отправил, но нет. Если бы кто-нибудь мог помочь, это было бы здорово!