2

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!

4

2 回答 2

5

如果您根本没有网络连接,您也会收到此错误。

于 2014-11-28T09:36:44.670 回答
4

SERVICE_NOT_AVAILABLE可能意味着您的设备无法读取响应或来自服务器的 500/503。你已经有一个指数回退,所以我想服务器端不应该是一个问题。看看你是否必须"com.google.android.c2dm.intent.REGISTRATION"在你的清单中使用 GCMBroadcastReceiver 并且你正在处理它。如果您还没有,请查看:Android 2.2 上的 GCM SERVICE_NOT_AVAILABLE 以获得详细的解决方案。评论是否有效。

于 2013-08-20T00:41:08.227 回答