2013-03-27 54 views
0

我面临Worklight推送通知的问题。Worklight WL.Client.Push.onReadyToSubscribe未被触发

我遵循Worklight 5.0.5的所有步骤,Module_41 _-_ Push_Notifications。 PDF文件,并做推演示。

我面临的一个错误,指出:

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

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

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

我已经设置

<pushSender password="Your_Password"/> 

,并重新生成和部署应用程序多次,但没有任何好处。

欢迎任何帮助或建议。

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码头时。我越来越低。

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":"[email protected]"},"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":"[email protected]"},"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帐户选取App ID登录 - >配置 - >启用推

  • 选择发展推SSL证书

  • 生成首先获得新的CSR,然后获得证书
  • 双击证书并从Keychain选择这个新的证书和私钥,然后右键单击并出口和在应用程序描述符的同级别保存为 APNS证书,sandbox.p12
  • 复制到工作灯,在App文件夹的根。 XML

  • 提供pushSender密码并给予securityTest

感谢

+0

编辑您的文章与更多的信息:哪个环境? iOS或Android(在Android的情况下是OS版本)。 –

+0

您是否向项目添加了启用推送证书?您是否使用启用了推送签名身份的Xcode在您的应用程序中签名? –

+0

是的,我提供了一个推送证书,指的是正确的分发证书。我希望你的意思是“通过推送签名身份在Xcode中签署你的应用程序?” – AAhad

回答

1

@Idan,

它现在已经得到解决。有两个原因:

  1. 复制工作灯应用程序文件夹内APNS证书后,必须重新生成&部署所有。您必须然后部署wlapp在WL consle .......那是不做的。
  2. 我对iPhone环境使用了一个错误的自定义安全领域,阻止WL服务器回应设备。

希望这个信息可以帮助其他人面临类似的问题。

谢谢

+0

请将此问题标记为已回答。 –

+0

我该如何回答? – AAhad

+0

Hi @AAhad你是如何重新生成和部署所有? – user1872384

0

请确保您有:

  1. 将iPhone环境添加到应用程序描述符。xml(使用Worklight提供的向导)
  2. 在iphone环境中添加了移动设备安全测试(请参阅如何安装Android环境;将其复制)
  3. 将.p12证书放置在应用程序文件夹中环境文件夹)
  4. 该证书的名称是“apns-certificate-sandbox.p12”(用于开发)或“apns-certificate-production.p12”(用于生产)
  5. 在pushSender元素

在应用程序中登录后,应该得到一个警报,说明你可以订阅。

要确保你有正确设置你的开发环境,按照本指南:Understanding and setting up artifacts required to use iOS devices and Apple Push Notifications services (APNS) in development environment

+0

是的@Idan,我也是这么做的。 – AAhad

+0

可以在您添加的日志中看到::找不到应用程序'PushApplication'的有效'aps-environment'授权字符串:(null)。通知不会被传送 - 在您的设置中有些事情是不正确的。您确定您在Xcode中使用了正确的bundleId,并且它与您选择的签名标识(也在Xcode中)相匹配吗?遵循本指南:http://goworklight.wordpress.com/2013/03/20/understanding-and-setting-up-artifacts-required-to-use-ios-devices-and-apple-push-notifications-services- apns-in-development-environment/ –

+0

的确,它看起来是我提供的正确的软件包ID。我在Mac上重新测试本地运行的应用程序,但没有成功。现在我正在检查我的客户的App在UAT阶段.......与此同时,如果您想确认其他任何步骤,请让我知道?或者你想要的任何东西,我可以在这里分享......谢谢 – AAhad