0
我正在嘗試向特定用戶的安裝發送推送通知。無法通過解析發送推送通知通過解析CloudCode
在用戶類中,我有一個指向安裝實例的指針。這是我的代碼:
Parse.Cloud.beforeSave("Notification", function(request, response) {
var user;
if (!request.object.get("reciever")) {
response.error("Please include a user");
} else {
user = request.object.get("reciever");
}
var message = request.object.get("message");
var query = new Parse.Query(Parse.User);
query.include("installation");
query.equalTo("objectID", user.get("objectID"));
query.find({
success: function(result) {
var obj = result[0];
var intst = obj.get("installation");
console.log(intst);
Parse.Push.send({
where: intst,
data: {
alert: message
}
}, {
success: function() {
console.log("Push was successful");
response.success();
},
error: function(error) {
console.error(error);
response.error(error);
}
});
},
error: function(error) {
response.error(error);
}
});
});
從查看我的日誌,安裝實例已正確接收。發送時,出現以下錯誤:
Failed to create new object, with error code: {"code":115,"message":"Missing the push channels."}
我在做什麼錯?