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

让人想犯罪 __ 提交于 2019-12-13 05:23:53

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!