【发布时间】:2015-05-07 06:00:44
【问题描述】:
实际上,我们已经完成了通过移动设备向移动设备发送推送概念。现在我们正在尝试使用 JavaScript 将推送通知从 Web 应用程序发送到移动设备。 我们试过这样
function authentication() {
Parse.$ = jQuery;
// Initialize Parse with your Parse application javascript keys
Parse.initialize("app key",
"script key");
var pushQuery = new Parse.Query(Parse.Installation);
pushQuery.equalTo("channels","Demo");
var promise = new Parse.Promise();
debugger;
Parse.Push.send({
where: pushQuery,
data: {
alert : "Hello word"
}}, { success: function() {
// Push was successful
alert : "Push was successful"
},
error: function(error) {
promise.reject(error);
}}).then (function(error) {
//Marks this promise as fulfilled,
//firing any callbacks waiting on it.
});
return promise;
}
我们遇到这样的错误
Failed to load resource: the server responded with a status of 400 (Bad Request)
code: 115
message: "Client-initiated push isn't enabled.
我们还启用了客户端推送
我们是推送通知的新手。请指导我们 提前致谢
【问题讨论】:
标签: javascript android cordova parse-platform push-notification