Worklight WL.Client.Push.onReadyToSubscribe没有被解雇

时间:2013-03-27 05:19:41

标签: ios apple-push-notifications ibm-mobilefirst

我正面临Worklight推送通知的问题。

我按照Worklight 5.0.5,Module_41 _-_ Push_Notifications的所有步骤进行操作。 PDF文件,并做了Push演示。

我正面临一个错误陈述:

  

[错误]无法订阅,通知令牌未更新   服务器

虽然在控制台上它确实显示了设备ID。 我的假设是 WL.Client.Push.onReadyToSubscribe 没有被解雇。

有人有类似的问题。 https://www.ibm.com/developerworks/forums/thread.jspa?threadID=456501

我已经设置了

<pushSender password="Your_Password"/> 

并多次重新生成和部署App但没有任何好处。

欢迎任何帮助或建议。

Environment:
WL 5.0.5 & 5.0.6
Xcode 4.2
iPhone (iOS 5.1 and 6.1)

我在本地mac再次尝试,通过iPhone 4,iOS 5.1进行测试。在设备中运行并连接到Studio jetty时。我到了下面。

Mar 27 11:23:49 Appsdev-iPhone PushApplication[211] <Warning>: Applications are expected to have a root view controller at the end of application launch
Mar 27 11:23:49 Appsdev-iPhone PushApplication[211] <Warning>: Web resources integrity test is disabled.
Mar 27 11:23:49 Appsdev-iPhone kernel[0] <Debug>: launchd[211] Builtin profile: container (sandbox)
Mar 27 11:23:49 Appsdev-iPhone kernel[0] <Debug>: launchd[211] Container: /private/var/mobile/Applications/5DA837C4-F039-4795-9509-C98383E40C68 [69] (sandbox)
Mar 27 11:23:49 Appsdev-iPhone PushApplication[211] <Warning>: Multi-tasking -> Device: YES, App: YES
Mar 27 11:23:51 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] ondeviceready event dispatched
Mar 27 11:23:51 Appsdev-iPhone PushApplication[211] <Warning>: {
        appVersionPref = "1.0";
        freeSpace = 14291787776;
        wlSkinLoaderChecksum = "(null)";
        wlSkinName = default;
    }
Mar 27 11:23:51 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] wlclient init started
Mar 27 11:23:51 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] Read cookies: null
Mar 27 11:23:51 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] CookieMgr read cookies: {}
Mar 27 11:23:51 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] Request [http://172.20.10.2:8080/apps/services/api/PushApplication/iphone/init]
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] Request [login]
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] Request [http://172.20.10.2:8080/apps/services/api/PushApplication/iphone/init]
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: DeviceAuthManager:getWorklightUniqueDeviceId --> returning UUID from the keychain
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] Request [http://172.20.10.2:8080/apps/services/api/PushApplication/iphone/init]
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] Clearing notification subscriptions.
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] Send new server notification token id.
Mar 27 11:24:12 Appsdev-iPhone SpringBoard[15] <Warning>: No valid 'aps-environment' entitlement string found for application 'PushApplication': (null). Notifications will not be delivered.
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] response [http://172.20.10.2:8080/apps/services/api/PushApplication/iphone/init] success: /*-secure-
    {"userPrefs":{},"WL-Authentication-Success":{"wl_remoteDisableRealm":{"userId":"null","attributes":{},"isUserAuthenticated":1,"displayName":"null"},"PushAppRealm":{"userId":"aahad","attributes":{},"isUserAuthenticated":1,"displayName":"aahad"},"wl_antiXSRFRealm":{"userId":"3l6ap8g9t4h9uk5rb1fmqfok15","attributes":{},"isUserAuthenticated":1,"displayName":"3l6ap8g9t4h9uk5rb1fmqfok15"},"wl_deviceNoProvisioningRealm":{"userId":"57B167E4-1258-4AD7-9DA1-92DC66A0451E","attributes":{"mobileClientData":"com.worklight.core.auth.impl.MobileClientData@6a76de98"},"isUserAuthenticated":1,"displayName":"57B167E4-1258-4AD7-9DA1-92DC66A0451E"}},"notificationSubscriptionState":{},"gadgetProps":{"directUpdate":{"updateUnpackedSize":1014255,"availableSkins":["default"],"checksum":4077143359,"updateSize":290080},"ENVIRONMENT":"iphone"},"userInfo":{"wl_authenticityRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"SampleAppRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_remoteDisableRealm":{"userId":"null","attributes":{},"isUserAuthenticated":1,"displayName":"null"},"PushAppRealm":{"userId":"aahad","attributes":{},"isUserAuthenticated":1,"displayName":"aahad"},"wl_antiXSRFRealm":{"userId":"3l6ap8g9t4h9uk5rb1fmqfok15","attributes":{},"isUserAuthenticated":1,"displayName":"3l6ap8g9t4h9uk5rb1fmqfok15"},"WorklightConsole":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_deviceAutoProvisioningRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_deviceNoProvisioningRealm":{"userId":"57B167E4-1258-4AD7-9DA1-92DC66A0451E","attributes":{"mobileClientData":"com.worklight.core.auth.impl.MobileClientData@6a76de98"},"isUserAuthenticated":1,"displayName":"57B167E4-1258-4AD7-9DA1-92DC66A0451E"},"myserver":{"userId":"aahad","attributes":{},"isUserAuthenticated":1,"displayName":"aahad"},"wl_anonymousUserRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null}}}*/

Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] wlclient connect success
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] before: app init onSuccess
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] after: app init onSuccess
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: [LOG] wlclient init success
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: Could not register for remote notifications: Error Domain=NSCocoaErrorDomain Code=3000 "no valid 'aps-environment' entitlement string found for application" UserInfo=0xfeafba0 {NSLocalizedDescription=no valid 'aps-environment' entitlement string found for application}
Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] <Warning>: [ERROR] Error while trying to retrieve device token from the mobile operating system.

查看附件快照。enter image description here enter image description here

生成APNS的步骤:

  • 登录Apple帐户,选择应用ID - &gt;配置 - &gt;启用推送

  • 选定开发推送SSL证书

  • 首先生成新的CSR,然后获得证书
  • 双击证书并从Keychain中选择此新证书及其私钥,然后右键单击并导出并另存为 apns-certificate-sandbox.p12
  • 复制到Worklight,位于application-descriptor.xml同级别的App文件夹的根目录

  • 提供了pushSender密码并给出了securityTest

由于

2 个答案:

答案 0 :(得分:1)

@Idan,

现在解决了。有两个原因:

  1. 在worklight App文件夹中复制APNS证书后,您必须重新生成&amp;全部部署。然后你必须在WL consle上部署wlapp .......那是不行的。
  2. 我在iPhone环境中使用了错误的自定义安全领域,阻止WL服务器响应设备。
  3. 希望此信息能够帮助其他人遇到类似问题。

    由于

答案 1 :(得分:0)

确保您拥有:

  1. 将iPhone环境添加到application-descriptor.xml(使用Worklight提供的向导)
  2. 将移动安全测试添加到iphone环境(了解如何为Android环境完成;复制它)
  3. 将.p12证书放在应用程序文件夹(与环境文件夹相同的级别)
  4. 证书名称为“apns-certificate-sandbox.p12”(用于开发)或“apns-certificate-production.p12”(用于生产)
  5. 在pushSender元素中添加了正确的密码
  6. 登录应用程序后,您应该收到一条警告,说明您可以订阅。

    要确保您已正确设置开发环境,请按照以下指南操作:Understanding and setting up artifacts required to use iOS devices and Apple Push Notifications services (APNS) in development environment