我正在开发应用程序,我希望为我使用GCM实现推送通知,我已经在谷歌控制台上注册了我的项目,并使用项目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
}
Run Code Online (Sandbox Code Playgroud)
我在AndroidManifest.xml中提供了所有必需的权限
我已经提到了以下链接
1)Android GCM SENDER_ID,如何获得它? 2)GCM出现错误:INVALID_SENDER偶尔出现在有两个GCM BroadcastReceivers的应用程序中 3)GCM无效的发件人错误 4)http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-消息-GCM-PHP和- MySQL的/