我正在开发应用程序,我想在其中实现推送通知,因为我正在使用 GCM,我已在 google console 上注册了我的项目,并使用项目 ID 作为 GCM 注册的 senderID。
GCMRegistrar.checkDevice(this); //no error
GCMRegistrar.checkManifest(this); //no error
final String regId = GCMRegistrar.getRegistrationId(this);
if (regId.equals("")) {
GCMRegistrar.register(this, "********"); //after this..
//onError method of GCMIntentService class
//is triggered, there I am printing error
//in log its saying INVALD_SENDER
}
我已在 AndroidManifest.xml 中授予所有必需的权限
我已经提到了以下链接
1) Android GCM SENDER_ID,如何获取?
2) 在具有两个 GCM BroadcastReceiver 的应用程序中偶尔出现 GCM 错误:INVALID_SENDER 3) GCM 无效发件人错误 4) http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/
SENDER_ID = 项目编号,我使用的是项目 ID。项目编号可在控制台上的项目 ID 旁边找到。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)