【问题标题】:Push notification with parse-push plugin & Ionic sent from parse dashboard but not received on Android device使用 parse-push 插件和 Ionic 从解析仪表板发送但在 Android 设备上未收到的推送通知
【发布时间】:2016-01-10 06:03:22
【问题描述】:

我正在使用带有 Ionic 的 parse-push 插件向 Android 设备发送推送通知。在解析仪表板上,通知显示为已发送,但设备上未收到通知。

这是我使用的 parse-push 插件-

cordova plugin add https://github.com/grrrian/phonegap-parse-plugin --variable APP_ID=<appId> --variable CLIENT_KEY=<clientKey>

这是我在 app.js 中的代码-

window.parsePlugin.initialize("<adppId>", "<clientKey>", function() {
    console.log('Parse initialized successfully.');

    window.parsePlugin.subscribe('DefaultChannel', function() {
      console.log('Successfully subscribed to DefaultChannel.');

      window.parsePlugin.getInstallationId(function(id) {
        // update the view to show that we have the install ID
        console.log('Retrieved install id: ' + id);

      }, function(e) {
        console.log('Failure to retrieve install id.');
      });

    }, function(e) {
      console.log('Failed trying to subscribe to DefaultChannel.');
    });

  }, function(e) {
    console.log('Failure to initialize Parse.');
  });

设备已注册为安装对象,并且如上所述正确订阅了频道。仍然没有发送推送通知。

任何人经历过或知道如何解决这个问题?

【问题讨论】:

    标签: android parse-platform notifications ionic


    【解决方案1】:

    您是否在 Parse 仪表板中为此设备注册了 deviceToken?

    我在 phonegap-parse-plugin 的某些版本中发现了类似的错误。尝试不同的分叉,例如:

    https://github.com/avivais/phonegap-parse-plugin

    https://github.com/bal200/phonegap-parse-plugin

    另外,您是否遵循了自述文件底部的 Android Quirks 部分?

    【讨论】:

    • 是的,我确实在 Parse 仪表板中注册了令牌。我想我还在我的项目中添加了 Ionic-push 插件,它与 parse-push 插件冲突。
    【解决方案2】:

    我可以通过以下方式解决这个问题:

    1. 删除用于推送通知的 ionic 插件(我已添加它以尝试使用 ionic-push 服务)并同时删除 parse-push 插件。

    2. 再次添加 parse-push 插件。

    这就像一个魅力!我认为 ionic-push 插件与我使用的 parse-push 插件冲突。需要检查他们各自的来源以确定冲突的确切位置,但现在我有来自解析的推送通知工作正常。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-08
      • 1970-01-01
      • 2015-02-09
      • 1970-01-01
      • 2016-12-15
      • 2016-02-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多