tec*_*ngs 4 android google-cloud-messaging
我已按照http://developer.android.com/guide/google/gcm/gs.html#server-app在我的应用中实施GCM
GCMRegistrar.checkDevice(this);
GCMRegistrar.checkManifest(this);
if (GCMRegistrar.isRegistered(this)) {
Log.d(TAG, GCMRegistrar.getRegistrationId(this));
}
final String regId = GCMRegistrar.getRegistrationId(this);
if (regId.equals("")) {
GCMRegistrar.register(this, sender_id);
Log.d(TAG, "Registration id : "+GCMRegistrar.getRegistrationId(this));
}
else {
Log.d("info", "already registered as" + regId);
}
Run Code Online (Sandbox Code Playgroud)
返回空字符串作为注册ID还需要什么才能获得注册ID?
Man*_*ani 10
设备未成功注册时出现空字符串.可能有以下原因 -
| 归档时间: |
|
| 查看次数: |
22212 次 |
| 最近记录: |