2013-03-27 51 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