SERVICE_NOT_AVAILABLE some devices on Android GCM

只愿长相守 提交于 2019-11-28 10:29:58

问题


I made an app using GCM for notifications. I used this tutorial and my code is pretty much identical

http://developer.android.com/google/gcm/client.html

I'm testing on physical devices and on some of the devices I am getting a SERVICE_NOT_AVAILABLE error when I try to register the device with GCM.

I have an exponential backoff setup so it does retry over time.

It works on about half of my test devices the others get a SERVICE_NOT_AVAILABLE error. Looked all over and haven't found a solution yet.

Any help would be greatly appreciated. Thank You!


回答1:


SERVICE_NOT_AVAILABLE might mean that your device can't read the response or there was a 500/503 from the server. You already have a exponential back-off so server side shouldn't be a problem I suppose. See if you have "com.google.android.c2dm.intent.REGISTRATION" to the GCMBroadcastReceiver in your manifest and you are handling that. Check out : GCM SERVICE_NOT_AVAILABLE on Android 2.2 for detailed solution, if you haven't already. Comment if that works.




回答2:


You will also get this error if you simply do not have network connection.



来源:https://stackoverflow.com/questions/18325099/service-not-available-some-devices-on-android-gcm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!