Google cloud messaging, service not available

白昼怎懂夜的黑 提交于 2020-01-21 09:01:48

问题


i'm creating an application and i'm using GCM to receive notifications, the problem is that when i call the function " gcm.register(SENDER_ID);" i'm getting "service not available". i searched a lot and many are facing this problem, i tried this solution:

GCM SERVICE_NOT_AVAILABLE on Android 2.2

but it is not working,(regId is null) please any one can help?


回答1:


The documentation says that:

When the application receives a com.google.android.c2dm.intent.REGISTRATION intent with the error extra set as SERVICE_NOT_AVAILABLE, it should retry the failed operation (register or unregister).

with other words, the registration failed on GCM servers and you should retry the operation again.

Make sure that you have Google Play Services installed on the device, and that you are on a stable internet connection.



来源:https://stackoverflow.com/questions/18766119/google-cloud-messaging-service-not-available

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