在文档中,关于为 Google Cloud Messaging 编写 Android 部分,描述了两个不同的选项:
- 使用com.google.android.gcm.GCMRegistrar,com.google.android.gcm.GCMBroadcastReceiver并com.google.android.gcm.GCMBaseIntentService在 http://developer.android.com/google/gcm/gs.html#android-app
- 使用android.content.BroadcastReceiver和+ 在http://developer.android.com/google/gcm/gcm.html#writing_appsandroid.app.IntentService中编写处理程序。
这令人困惑。推荐的方法是什么?