Answer the question
In order to leave comments, you need to log in
Why is an empty DeviceID returned when enrolling in GCM (C2DM) on a device?
I register an Android device in GCM (C2DM). Everything is fine in the emulator, I get the deviceId and successfully send messages to it.
But when I install the application on a live phone, the deviceId is empty. It doesn't throw any errors, it just returns an empty value.
GCMRegistrar.checkDevice(this);
GCMRegistrar.checkManifest(this);
deviceId = GCMRegistrar.getRegistrationId(this);
if (deviceId != null && !deviceId.equals("")) {
GCMRegistrar.register(this, "xxxxxxxxxxxxx" );
deviceId = GCMRegistrar.getRegistrationId(this);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question