问题
I have tested my application on my phone and eclipse emulator(targeted at google api level 16), but the coming notification will only show up in the notification bar in the real phone but not in emulator. Any ideas whats going on here?
回答1:
Can you check that you can get a regID
when you work on emulator?
GCMRegistrar.checkDevice(this);
GCMRegistrar.checkManifest(this);
final String regId = GCMRegistrar.getRegistrationId(this);
if (regId.equals("")) {
GCMRegistrar.register(this, SENDER_ID);
} else {
Log.v(TAG, "Already registered");
}
来源:https://stackoverflow.com/questions/13490762/gcm-notification-doesnt-show-up-in-the-notification-bar-android