且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android的解析推送通知在Android中不工作

更新时间:2023-02-26 21:06:19

无论出于何种原因,分析有两个教程;一个是完整的,而另一个不是。猜你发现哪一个。

For whatever reason, Parse has two tutorials; one is complete and the other isn't. Guess which one you found.

完整的一个是在这里:
https://www.parse.com/tutorials/android-push-notifications

The complete one is here: https://www.parse.com/tutorials/android-push-notifications

从本质上讲,你缺少的步骤5.在应用类,在的onCreate 方法...

Essentially, you are missing step 5. In your Application class, in the onCreate method...

ParsePush.subscribeInBackground("", 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);
    }
  }
});