Comments (24)
Hi @2fours and others,
"NotRegistered" indicates that the registration has been invalidated.
Since there can be several reasons why this is happening it's very difficult to investigate and answer all your bug reports together.
Also this bug-tracker is about the sample code that you can find in the repo.
For more generic GCM support please see:
https://developers.google.com/cloud-messaging/support
Last thing:
The most likely cause for the behavior you described above is a bad GCM configuration in your app.
Please check your manifest for permissions and broadcast receivers.
from gcm.
Hello, iam also facing the same problem but on an Android 4.4.2 device.
Surprisingly everything works well on a 4.1.1 device, but the 4.4.2 does not
even receive the messages and after a couple of hours it says NotRegistered.
Original comment by [email protected]
on 20 Feb 2015 at 1:43
from gcm.
I am registering the device on startup, so I am storing the registration_id everytime the user comes onto the app. The push notifications go fine for a while but after few hours or a day the gcm server starts returning "NotRegistered" error, what is the problem ?
Is there a possibility that the registration id has a TTL ? , How do we refresh the registration_id in that case ?
from gcm.
@aelor Check https://developers.google.com/cloud-messaging/server-ref#error-codes
Unregistered Device
200 + error:NotRegistered
DEVICE_UNREGISTERED
An existing registration token may cease to be valid in a number of scenarios, including:
- If the client app unregisters with GCM.
- If the client app is automatically unregistered, which can happen if the user uninstalls the application. For example, on iOS, if the APNS Feedback Service reported the APNS token as invalid.
- If the registration token expires (for example, Google might decide to refresh registration tokens, or the APNS token has expired for iOS devices).
- If the client app is updated but the new version is not configured to receive messages.
For all these cases, remove this registration token from the app server and stop using it to send messages.
And as of EDIT (04.24.2014) : as per http://stackoverflow.com/a/16839326/313113 tokens do not refresh after a certain period. And it seems there is a bug when the user upgrades the app and you send a notification at the same time when the upgrade happens, the token gets unregistered, so you have to register again after an app upgrade.
from gcm.
I also have this problem before, but it fix once you make sure your registratio_id is the right one after you re-install the app or similar behaviors.
from gcm.
The issue should have been fixed on devices using Google Play Services, can you try and report if you're still experiencing this issue?
from gcm.
Seeing this right now in dev with a phone running 2.3.3. As you can see from the server output below, it sends a message to the gcm id (that was just uploaded from the client), gets back success, then the next push seconds later to the same id fails. Neither push message is received on the phone.
{"name":"surespot","hostname":"jarvis","pid":10188,"level":20,"msg":"sending push messages to: d0T-iPDpR7w:APA91bHQbI6OULGzTT5s5JOeZPQr50ZoecB4FROpQNzDDxZMJQ9brYIk91JiP4HTj4Rxdv_f2A729AprHkDlsrBdUTggXviYuRYRokrv1_j53lNfC11O1NGIVSf2q49bue4qFWLwC_Vq","time":"2015-09-30T19:26:08.904Z","v":0}
{"name":"surespot","hostname":"jarvis","pid":10188,"level":20,"msg":"sendGcm result: {"multicast_id":5823607767841352000,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1443641169031627%cc2cfd77f9fd7ecd"}]}","time":"2015-09-30T19:26:09.058Z","v":0}
{"name":"surespot","hostname":"jarvis","pid":10188,"level":20,"msg":"sending push messages to: d0T-iPDpR7w:APA91bHQbI6OULGzTT5s5JOeZPQr50ZoecB4FROpQNzDDxZMJQ9brYIk91JiP4HTj4Rxdv_f2A729AprHkDlsrBdUTggXviYuRYRokrv1_j53lNfC11O1NGIVSf2q49bue4qFWLwC_Vq","time":"2015-09-30T19:26:14.835Z","v":0}
{"name":"surespot","hostname":"jarvis","pid":10188,"level":20,"msg":"sendGcm result: {"multicast_id":6046882289383898000,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"NotRegistered"}]}","time":"2015-09-30T19:26:14.972Z","v":0}
from gcm.
{"multicast_id":xxxxxxxxxxxxxxxxx,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"NotRegistered"}]}
Also seeing this bug after first message sent - Samsung device running Andriod 4.2.2
from gcm.
GCM register() is deprecated starting May 28, 2015. New app development should use the Instance ID API to handle the creation, rotation, and updating of registration tokens. For more information, see Registering Client Apps and Set up a GCM Client App on Android. For more see>> https://developers.google.com/cloud-messaging/android/legacy-regid
from gcm.
Thanks. The reason I'm seeing this issue is because I'm trying to upgrade my app to use the Instance ID. With the deprecated code there is no problem.
from gcm.
I'm running into this error as well. I had a customer uninstall the app (clearing any token they had) and reinstall. They received a token but pushing to that token produces the NotRegistered error on the app (push) server. The time between reinstall and push was less than 5 minutes so I don't see how that token could have been unregistered.
Edit (10/23): The error I was receiving was related to the Client's API, not an issue with GCM.
from gcm.
So based on the lack of response from Google the answer seems to be keep using the working, deprecated code. Thanks.
from gcm.
@2fours @ogeidix I discovered that the registration token retrieved using instanceId.getToken()
has the instanceId appended to the front along with the registration token. It is no longer similar to the format of the registration token returned from the deprecated gcm.register()
If you use the registration token from gcm.register()
while keeping everything updated according to the latest google doc, then everything will work. So I have no idea how we can make use of the new registration Token
from gcm.
@MetaRobot no dice, still have the same issue.
from gcm.
Im having the same issue on even 5.1.1 also. The problem is reinstalling generates a new token but the token is in 'NotRegistered' state from the start. Reinvoking the instanceId listener from adb fixes this and I manage to get a proper token.
from gcm.
@2fours I am sorry we could not find the issue that is affecting your setup with InstanceID.
- Can you try your application on different device / android versions ?
- Could you try one of the demo / quickstart to see if those applications work?
@humblerookie Please check your manifest for permissions and broadcast receivers.
If you cannot find anything wrong, could you try the same steps I wrote above for 2fours ?
The tokens generated from InstanceId should work normally.
If they become "NotRegistered" it means that, upon delivering a message, the device could not find an app with the right name and the right gcm configuration, thus a deleteToken() is automatically issued.
from gcm.
@ogeidix Thanks. I managed to to figure out the reason for the same. In my case there was an external library that was registering via instance id again. In this scenario at times the token with me and the token with the library were different. Apologies for the same.
from gcm.
hello friends ,
i am using GCM and getting below error in after some time. Please give me a solution.
Thanks in advance
{"registration_ids":["APA91bGrAODQE9IU88gOHKCDo7n70RQhoHFcDoqR2kKnQXmo8LrZRR7GSjMP74ocYnCJ3jnqyNNYlY6RISg8D9iyvHbK3i3gcPr4yI2UTSal7RwZY9zdZxc"],"data":{"player_id":"2424","opponent_id":"0","title":"Empass","room_name":"14541","message":"Ankur has declined your request to connect at this time. We hope you don't mind this","tag":"Chat","flag":"VIRTUAL"}}{"multicast_id":5211458907938656031,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"NotRegistered"}]}
from gcm.
Hi @deepakjainmobifly
you can use the link below to contact the GCM support:
https://support.google.com/code/contact/gcm_dev_support
from gcm.
i have some weird behavior on iOS GCM,i try to use "notification"
in my Json and after 2 request it throws me NotRegistered
, but when i use "data" : { "message" : {} }
it works fine
from gcm.
@aliiizzz please open a new issue. The same error could have different origin depending on your configuration / platform etc.
from gcm.
@aliiizzz I am having the same problem as well. I was trying to make the GCM works on iOS background and it got unregistered.
from gcm.
Hi @ghost,
This problem occurred to me also and I sorted out this but before that just tell me are you trying to debug locally or on server.
from gcm.
Hi All,
Is there a well known resolution to this problem? We are facing this issue also in App upgrade and OS upgrade scenarios.
from gcm.
Related Issues (20)
- Issue Regarding Notification Display. HOT 1
- com.google.android.gcm.server.Sender fix ip address for gcm push notification sender
- Not receiving notification on some Custom OS after reboot
- am not able to get notification in bar when app is opened
- Message.Builder().contentAvailable(true)
- GCM and Play Services GCM
- GCM Dry run gives mismatch http post response
- I am getting below error message, while connecting the gcm through proxy org.apache.http.client.ClientProtocolException
- java.lang.NullPointerException in com.google.android.gms.gcm.GcmListenerService.zzm
- GCM Not receiving push notification in Canada
- Delete
- GCM send calls are failing -Android https://android.googleapis.com/gcm/send (push notification) HOT 1
- Don't have new release with FCM update HOT 3
- UTF-8 support is not present on Server side FCM/GCM push HOT 1
- I forgot my email id from which, i have created GCM Sender id .any way to find email id
- Delay on GCM Push Notifications sent from salesforce server.
- How to know if the requests to GCM have stopped?
- It looks like the data is there, it is just parcelled. If you try to get a particular key/value it should show up. You can always do something like intent.getStringExtra("date") before logging the Intent to force its data to unparcel.
- Not allowed to bind to service Intent HOT 2
- Security Policy violation Binary Artifacts HOT 84
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gcm.