我可以在我的Android应用程序中向一个特定设备(可能带有设备ID?)而不是每个设备发送推送消息吗?
一个简单的"是的,那可能是解析"或"不,你不能使用解析"就足够了!如果ans是,那么我需要知道如何.....
GCMRegistrar.checkDevice(this);
GCMRegistrar.unregister(this);
GCMRegistrar.checkManifest(this);
if (GCMRegistrar.isRegistered(this)) {
GCMRegistrar.getRegistrationId(this));
}
regId = GCMRegistrar.getRegistrationId(this);
l.setText(regId);
if (regId.equals("")) {
GCMRegistrar.register(this, "187805647345");
GCMRegistrar.getRegistrationId(this));
l.setText(regId);
}
else {
GCMRegistrar.getRegistrationId(this));
}
Toast.makeText(RegisterHalf.this,""+regId,2000).show();
Run Code Online (Sandbox Code Playgroud)
当我运行应用程序时,我得到device id = null
但是当我第二次运行时device id 有一个值.
请告诉我为什么会这样.