1

我收到 [C2DMReg] handleRequest

org.apache.http.auth.AuthenticationException

在尝试从谷歌服务器获取注册 ID 时。这是 logcat 跟踪:

02-24 19:10:26.951: WARN/DefaultRequestDirector(122): Authentication error: Unable to respond to any of these challenges: {}
02-24 19:10:26.969: DEBUG/C2DMRegistrar(122): [C2DMRegistrar.24] register: http error 401
02-24 19:10:26.969: ERROR/C2DMRegistrar(122): [C2DMReg] handleRequest caught org.apache.http.auth.AuthenticationException

但是我能够获取注册 ID。但是当我尝试将味精发送到设备时,我得到一个异常是

javax.net.ssl.SSLHandshakeException:无法验证 SSL 证书:https ://android.apis.google.com/c2dm/send

可能是什么原因?我为 C2DM 服务注册了我的电子邮件 ID 已经 24 小时。我收到了他们的邮件。但它仍然不起作用。

4

1 回答 1

0

Android 设备 c2dm 似乎只接受 *.apis.google.com 证书。尝试设置一个假的 HostnameVerifier,如下所述:

http://groups.google.com/group/android-c2dm/browse_thread/thread/49e902657d76a530

更新:

有一个名为ChromeToPhone的项目,它将 URL 从浏览器插件发送到 AppEngine 后端,然后通过 C2DM 发送到 Android 手机。

查看他们的源代码以了解他们如何在 AppEngine 上实现 C2DM 可能会有所帮助:http ://code.google.com/p/chrometophone/source/browse/#svn%2Ftrunk%2Fappengine

于 2011-02-24T12:19:36.787 回答