Android GCM没有注册设备

时间:2013-08-26 10:53:06

标签: android google-cloud-messaging

代码:

String msg = "";
try {
    if (gcm == null) {
        gcm = GoogleCloudMessaging
        .getInstance(OrfografApplication.this);
    }
    String senderId = Constants.GCM_SENDER_ID;
    GCM_REGISTRATION_ID = gcm.register(Constants.GCM_SENDER_ID);
    msg = "Device registered, registration id="
                    + GCM_REGISTRATION_ID;
    setRegistrationId(OrfografApplication.this,
                        GCM_REGISTRATION_ID);
} catch (IOException ex) {
    Log.w(TAG, ex.getMessage());
    msg = "Error :" + ex.getMessage();
}
return msg;

异常消息SERVICE_NOT_AVAILABLE

在logcat : W/GCM(749): DIR: /data/data/com.google.android.gms/app_APP /data/data/com.google.android.gsf

它运作良好,但在8月23日停止。

1 个答案:

答案 0 :(得分:0)

查看SERVICE_NOT_AVAILABLE GCM上的答案。这可能有很多原因。其中一个可能是设备无法读取响应或服务器有500/503。显然还有一个bug report,尚未解决。请参阅上面链接中的详细信息。

相关问题