0

Hiii,我在 android 中使用 parse push 进行推送通知,当我从 parse.com 手动尝试时,它工作正常,但是当我使用 WordPress 自动从其帖子发送通知时,问题就出现了。因为当 WordPress 发送发布设备时无法收到任何通知,当我在 parse.com 中检查仪表板时,我看到的目标是频道。现在我想知道我如何将目标更改为“所有人”而不是“频道”。

编码 :

ParseAnalytics.trackAppOpened(getIntent());
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
if(!prefs.getBoolean("firstTime", false)) {
PushService.subscribe(getBaseContext(), "", Home.class);
showToast("You are subscribed for the push Notification You can unsubscribe it in Settings");
SharedPreferences.Editor editor = prefs.edit();
editor.putBoolean("firstTime", true);
editor.commit();
}

// inform the Parse Cloud that it is ready for notifications
PushService.setDefaultPushCallback(this, Home.class);


ParseInstallation.getCurrentInstallation().saveInBackground();
4

1 回答 1

0

我在这里保留了 prefrence 选项,以便它只会执行一次,检查代码并让我知道....

 ParseAnalytics.trackAppOpened(getIntent());
    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
    if(!prefs.getBoolean("firstTime", false)) {
    PushService.subscribe(getBaseContext(), "", Home.class);
    showToast("You are subscribed for the push Notification You can unsubscribe it in Settings");
    SharedPreferences.Editor editor = prefs.edit();
    editor.putBoolean("firstTime", true);
    editor.commit();
    }

    // inform the Parse Cloud that it is ready for notifications
    PushService.setDefaultPushCallback(this, Home.class);


    ParseInstallation.getCurrentInstallation().saveInBackground();
于 2014-03-04T08:50:14.183 回答