簡體   English   中英

通過Android App向所有人發送Parse Push

[英]Send Parse Push to everyone from Android App

也許有人可以幫助我! 我想從一個簡單的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();

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

您只需要啟用“發送通知”。

  1. 前往Parse.com
  2. 前往設置
  3. 去推
  4. 轉到“啟用客戶端推送?”
  5. 設置它。

請享用!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM