【问题标题】:How to send push notification from web application to android device using Parse?如何使用 Parse 从 Web 应用程序向 Android 设备发送推送通知?
【发布时间】: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


    【解决方案1】:

    com 第1步 : 1.在 parse.com 中创建您的项目 2.在您的项目中添加解析推送通知ID。 3.从 parse.com 您将有发送按钮发送推送通知点击并发送您的消息。

    休耕这个链接 http://www.androidbegin.com/tutorial/android-parse-com-push-notification-tutorial/ www.parse.com

    【讨论】:

    • 我们完成了从移动设备向移动设备发送推送通知,但现在我们需要将推送通知从 Web 应用程序发送到移动设备,因为我们在 Web 应用程序中使用 javascript。问题无法连接到解析服务器得到 400(错误请求)。我们哪里出错了无法理解
    • 你首先检查从解析网站到你的移动天气它正在工作不是基于我稍后发送你更新到你的自定义代码的链接
    猜你喜欢
    • 1970-01-01
    • 2011-06-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-04
    • 1970-01-01
    • 2019-06-10
    相关资源
    最近更新 更多