【发布时间】:2013-03-14 08:17:02
【问题描述】:
我已经下载了推送通知模块的示例应用程序,并尝试在三星 Tab 2 上运行它。我发现它需要 senderId 和 Key,因此我使用 Google 的 GCM 控制台创建了这些值。然后,我运行了应用程序,它成功了。然后我通过示例应用程序订阅并按下登录按钮。登录后,我的 LogCat 显示如下:
03-14 13:03:10.648:V/GCMRegistrar(9351):在应用程序版本上保存 regId 1 03-14 13:03:10.648: D/WLDroidGap(9351): 在 GCM 服务器上注册 有注册ID APA91bEUF25J1woHwcfEhG-73XXUyRJw6ul26VF0GQJBJQ9gtgjg0QK5gQ9Nq2sAeHiOKCJGRlJJvZ_0CvibjwS_eg9IUkHKez9zVxbgCtPsWj85DuHv6JbzydQY182-HvkbfM45lGG8cZnhF_Qndek
03-14 13:03:10.671:D/WLDroidGap(9351):通知 javascript on 注册成功
03-14 13:03:10.679: D/PushApplication(9351): 推送通知设备 令牌已更改,正在更新服务器通知令牌 ID。
03-14 13:03:10.687: D/PushApplication(9351): 请求 [http://192.168.1.206:8080/apps/services/api/PushApplication/android/notifications]
03-14 13:03:10.710: D/PushApplication(9351): 响应 [http://192.168.1.206:8080/apps/services/api/PushApplication/android/notifications] 成功:/*-secure-
03-14 13:03:10.710: D/PushApplication(9351): {"errors":[],"isSuccessful":true,"warnings":[],"info":[]}*/
03-14 13:03:12.914: D/PushApplication(9351): 请求 [http://192.168.1.206:8080/apps/services/api/PushApplication/android/notifications]
03-14 13:03:12.929:D/WLDroidGap(9351):Javascript 脚本请求 调度到 WL.Client.Push.__onmessage
03-14 13:03:52.625:D/PushApplication(9351):请求 [登录]
03-14 13:03:52.695: D/PushApplication(9351): 请求 [http://192.168.1.206:8080/apps/services/api/PushApplication/android/notifications]
03-14 13:03:52.750: D/PushApplication(9351): 响应 [http://192.168.1.206:8080/apps/services/api/PushApplication/android/notifications] 成功:/*-secure-
03-14 13:03:52.750: D/PushApplication(9351): {"isSuccessful":true,"WL-Authentication-Success":{"PushAppRealm":{"userId":"hello_13@gmail.com","attributes":{},"isUserAuthenticated":1,"displayName": "hello_13@gmail.com"}}}*/
然后过了一段时间我的日志猫显示:
unregisterReceivers:接收方未注册:com.worklight.androidgap.plugin.Push$1@4128e920
Web 控制台上出现此错误:
{"WL-Authentication-Success":{"wl_deviceNoProvisioningRealm":{"userId":"device","attributes":{"mobileClientData":"com.worklight.core.auth.impl.MobileClientData@e0d191" },"isUserAuthenticated":1,"displayName":"device"}},,"WL-Authentication-Failure":{"wl_remoteDisableRealm":{"reason":"登录失败"}}}*/
登录并订阅后,它不会显示任何让我知道通知是否成功推送的信息。
【问题讨论】: