我们已经完成了将移动推送概念发送到移动设备。现在我们正在尝试使用javascript从网络应用程序向移动设备发送推送通知。 我们试过这个
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.
我们也启用了客户端推送
我们是Push的新手.plz指导我们 提前致谢
答案 0 :(得分:0)
COM 步骤1 : 1.在parse.com中创建你的项目 2.在项目中添加解析推送通知ID。 3.from parse.com您将发送按钮发送推送通知点击并发送您的消息。
休会这个链接 http://www.androidbegin.com/tutorial/android-parse-com-push-notification-tutorial/ www.parse.com