【问题标题】:Send Parse Push to everyone from Android App从 Android 应用程序向所有人发送 Parse Push
【发布时间】:2015-08-03 14:45:50
【问题描述】:

也许任何人都可以帮助我!我想从一个简单的 android 应用程序向每个注册的设备发送推送通知。 (对所有人)。有一些工作示例如何使用 php 实现这一点,但我不知道如何向所有人(无频道)发送推送通知?

到目前为止我已经找到了这些信息,但它不起作用

我的频道是“”,目标是向所有设备发送推送!

    ParseQuery pushQuery = ParseInstallation.getQuery();
        pushQuery.whereEqualTo("channels", "");


  ParsePush push = new ParsePush();
        push.setQuery(pushQuery); // Set our Installation query
        push.setMessage("Hello world!");
        push.sendInBackground();

我已经像这样更改了我的代码,但它仍然无法正常工作!

ParsePush.subscribeInBackground("bugatti", new SaveCallback() {
            @Override
            public void done(ParseException e) {
                if (e == null) {
                    Log.d("com.parse.push", "successfully subscribed to the broadcast channel.");
                } else {
                    Log.e("com.parse.push", "failed to subscribe for push", e);
                }
            }
        });


  ParseQuery pushQuery = ParseInstallation.getQuery();
       pushQuery.whereEqualTo("channels", "bugatti");

   ParsePush push = new ParsePush();
      push.setQuery(pushQuery); 
        push.setChannel("bugatti");
        push.setMessage("Hello world!");
        push.sendInBackground();

如果有人可以帮助我,那就太好了!

【问题讨论】:

  • 为什么不创建一个所有设备都订阅的频道?
  • 我已经通过订阅频道“bugatti”对其进行了测试,但它仍然无法正常工作:(
  • 客户端推送已关闭 ....:) 已解决

标签: android parse-platform push


【解决方案1】:

您只需要启用“发送通知”。

  1. 访问 Parse.com
  2. 进入设置
  3. 去推送
  4. 转到“启用客户端推送?”
  5. 设置它。

享受吧!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多