Giter VIP home page Giter VIP logo

Comments (24)

ogeidix avatar ogeidix commented on August 19, 2024 1

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.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 19, 2024
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.

aelor avatar aelor commented on August 19, 2024

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.

alibitek avatar alibitek commented on August 19, 2024

@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.

DonLiangGit avatar DonLiangGit commented on August 19, 2024

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.

silvolu avatar silvolu commented on August 19, 2024

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.

2fours avatar 2fours commented on August 19, 2024

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.

Moworks avatar Moworks commented on August 19, 2024

{"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.

sabitraj avatar sabitraj commented on August 19, 2024

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.

2fours avatar 2fours commented on August 19, 2024

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.

afahrenholtzmcgladrey avatar afahrenholtzmcgladrey commented on August 19, 2024

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.

2fours avatar 2fours commented on August 19, 2024

So based on the lack of response from Google the answer seems to be keep using the working, deprecated code. Thanks.

from gcm.

boxme avatar boxme commented on August 19, 2024

@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.

2fours avatar 2fours commented on August 19, 2024

@MetaRobot no dice, still have the same issue.

from gcm.

humblerookie avatar humblerookie commented on August 19, 2024

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.

ogeidix avatar ogeidix commented on August 19, 2024

@2fours I am sorry we could not find the issue that is affecting your setup with InstanceID.

  1. Can you try your application on different device / android versions ?
  2. 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.

humblerookie avatar humblerookie commented on August 19, 2024

@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.

 avatar commented on August 19, 2024

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.

ogeidix avatar ogeidix commented on August 19, 2024

Hi @deepakjainmobifly
you can use the link below to contact the GCM support:
https://support.google.com/code/contact/gcm_dev_support

from gcm.

aliiizzz avatar aliiizzz commented on August 19, 2024

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.

ogeidix avatar ogeidix commented on August 19, 2024

@aliiizzz please open a new issue. The same error could have different origin depending on your configuration / platform etc.

from gcm.

maxchu92 avatar maxchu92 commented on August 19, 2024

@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.

gurjarr587 avatar gurjarr587 commented on August 19, 2024

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.

tarunanand avatar tarunanand commented on August 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.