简体   繁体   中英

GCM notification doesn't show up in the notification bar. Android

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?

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");
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM