I had this error when I had the gcm receiver outside of the application in the manifest file. Moved the receiver into the application scope and everything worked. A very happy bunny now.
If you are using a device for testing, you need to delete the InstanceID before obtaining the token and re-testing because once you overwrite your APK it de-registers that InstanceId and you get that NotRegistered error. So in your RegisterIntentService class, in the onHandleIntent function do the following:
This means simply your are giving a wrong registration Id.
So for this, first run your mobile application and your registration ID will come as token.
Put this token to your app server code as registration ID.
For App ID give server ID, which you could get from Google developer console,your project,And credentials.
For sender Id , set your project ID which could aquire from project,settings in developer console.
GCM response Not Registered means following "If it is NotRegistered, you should remove the registration ID from your server database because the application was uninstalled from the device or it does not have a broadcast receiver configured to receive com.google.android.c2dm.intent.RECEIVE intents." from documentation. Check in what case you get this error, when app is uninstalled from the device or you describe incorrect broadcast receiver in AndroidManifest. You can test your GCM functionality with my test GCM server. Hope, this helps you.
I had this error when I had the gcm receiver outside of the application in the manifest file. Moved the receiver into the application scope and everything worked. A very happy bunny now.
If you really think your code is correct and still getting error
try un-installing app manually from phone and run it again (your device will get new registration ID).
At least in my case the problem was solved!
A Google account is a requirement on devices running Android 4.0.4 or lower. http://developer.android.com/google/gcm/gcm.html
You should also add
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
in your manifest file.If you are using a device for testing, you need to delete the InstanceID before obtaining the token and re-testing because once you overwrite your APK it de-registers that InstanceId and you get that NotRegistered error. So in your RegisterIntentService class, in the onHandleIntent function do the following:
This means simply your are giving a wrong registration Id. So for this, first run your mobile application and your registration ID will come as token. Put this token to your app server code as registration ID. For App ID give server ID, which you could get from Google developer console,your project,And credentials. For sender Id , set your project ID which could aquire from project,settings in developer console.
GCM response
Not Registered
means following "If it isNotRegistered
, you should remove the registration ID from your server database because the application was uninstalled from the device or it does not have a broadcast receiver configured to receive com.google.android.c2dm.intent.RECEIVE intents." from documentation. Check in what case you get this error, when app is uninstalled from the device or you describe incorrect broadcast receiver in AndroidManifest. You can test your GCM functionality with my test GCM server. Hope, this helps you.