[英]How to send push notification from web application to android device using Parse?
我们已经完成了将移动推送概念发送到移动设备。现在我们正尝试使用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.
我们也启用了Client Push
我们是Push的新手.plz指导我们提前致谢
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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.