我想在我的應用程序中實現谷歌雲消息。我有一個類GCMIntentService,我添加權限來體現這個代碼添加到主要活動:GCM在android還有什麼其他
checkNotNull(SENDER_ID, "SENDER_ID");
GCMRegistrar.checkDevice(this);
GCMRegistrar.checkManifest(this);
requestWindowFeature(Window.FEATURE_ACTION_BAR);
setContentView(R.layout.activity_main);
extras = getIntent().getExtras();
if (savedInstanceState == null) {
if (extras == null) {
GlobalConfig.setAPPLICATION_ID(APP_ID);
} else {
GlobalConfig.setAPPLICATION_ID(extras.getInt("application_id", 0));
}
} else {
MY_DEBUG.print("SavedInstanceState is not null");
}
GlobalConfig.setBookmark(0);
//notifications
final String regId = GCMRegistrar.getRegistrationId(this);
Log.i(TAG, "registration id " + regId);
if (regId.equals("")) {
GCMRegistrar.register(this, SENDER_ID);
} else {
Log.v(TAG, "Already registered");
}
我得到的RegID,但我需要什麼都可以從谷歌得到的消息?我使用webservice連接。我需要發送此REGID服務?我的下一步應該是什麼?