如何获得C2DM身份验证令牌?

时间:2011-02-15 11:13:45

标签: android android-c2dm auth-token

我正在研究android c2dm一段时间。

上周,我在模拟器的logcat中获得了注册ID,但我仍然无法获得身份验证令牌。

还有一些错误&我的logcat中的警告消息:

**02-15 10:41:39.092: WARN/DefaultRequestDirector(176): Authentication error: Unable to respond to any of these challenges: {}**

**02-15 10:41:39.102: ERROR/C2DMRegistrar(176): [C2DMReg] handleRequest caught org.apache.http.auth.AuthenticationException**

02-15 10:41:42.601: INFO/System.out(487): APA91bF_B-VagQ9pO1toPGGMUYMBAURfgyL1AAa6Y8fn5WKf2DSj0qJINnlJIQ_MRoJBVdo9hMvJu1hLjHid-rk37zOFuOaY5A

02-15 10:41:42.601: INFO/System.out(487): [ 02-15 10:41:42.601   487:0x1f3 I/1registrationid=APA91bF_B-VagQ9pO1toPGGMUYMBAURfgyL1AAa6Y8fn5WKf2DSj0qJINnlJIQ_MRoJBVdo9hMvJAPA91bF_B-VagQ9pO1toPGGMUYMBAURfgyL1AAa6Y8fn5WKf2DSj0qJINnlJIQ_MRoJBVdo9hMvJu1hLjHid-rk37zOFuOaY5A

02-15 10:41:42.642: INFO/C2DMReceiver-onRegistered(487): APA91bF_B-VagQ9pO1toPGGMUYMBAURfgyL1AAa6Y8fn5WKf2DSj0qJINnlJIQ_MRoJBVdo9hMvJu1hLjHid-rk37zOFuOaY5A

**02-15 10:41:42.713: WARN/DeviceRegistrar(487): 2Registration error the name must not be empty: null**

现在我正在尝试使用chrometophone的源代码,但仍然没有获得身份验证令牌......

我错过了什么,我怎样才能获得身份验证令牌?

1 个答案:

答案 0 :(得分:0)

您是否真的从一台设备向另一台设备发送消息?通常在生成消息的Web服务器上需要auth令牌。设备不需要auth令牌 - 它获取注册ID,将其传递给服务器并期望消息。