Android GCM “error”:“NotRegistered”

2020-02-12 06:33发布

I am using Android GCM Push service, it works great for some time, but if I keep my application Idle for some minutes, or when i rerun it after some modifications in the code i get no messages and the GCM server give me this error :"NotRegistered" i did some resurch i found this posted question but i cant comment there yet (low reputation :( and the post is so old)

While going through it i undrestand that sometime Google server can refresh registration id automatically, So what i need to know is when exactly the GCM server dose these modifications on the regestration id and how to update my saved regID in my database

I'm new so hope that my question is clear Thank you for helping me out

1条回答
Explosion°爆炸
2楼-- · 2020-02-12 06:43

If you change some of your codes, and reinstall the app on your device, the last token may changed. Google may update the token on these cases:

  • App update
  • Re installation
  • Clearing the app data

Then you should handle the onTokenRefresh your self to save the token and update it in your server database.

查看更多
登录 后发表回答