在文档中,关于为 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
中编写处理程序。
这令人困惑。推荐的方法是什么?