title: Worklight WL.Client.Push.onReadyToSubscribe not getting fired
body: <p>I am facing an issue with Worklight Push Notification.</p>
  
  <p>I followed all steps of Worklight 5.0.5, Module_41_-_Push_Notifications.
  PDF  file, and did Push demo.                                           </p>
  
  <p>I am facing an error stating:</p>
  
  <blockquote>
    <p>[ERROR] Can't subscribe, notification token is not updated on the
    server</p>
  </blockquote>
  
  <p>Although on the console it does show the device ID. 
  My assumption is <strong>WL.Client.Push.onReadyToSubscribe</strong> not getting fired.</p>
  
  <p>Someone had similar issues.
  <a href="https://www.ibm.com/developerworks/forums/thread.jspa?threadID=456501" rel="nofollow noreferrer">https://www.ibm.com/developerworks/forums/thread.jspa?threadID=456501</a></p>
  
  <p>I have set </p>
  
  <pre><code>&lt;pushSender password="Your_Password"/&gt; 
  </code></pre>
  
  <p>and re-generated and deployed App multiple times but no benefit.</p>
  
  <p>Any help or suggestion are welcome.</p>
  
  <pre><code>Environment:
  WL 5.0.5 &amp; 5.0.6
  Xcode 4.2
  iPhone (iOS 5.1 and 6.1)
  </code></pre>
  
  <p>I tried once again on local mac, testing via iPhone 4 , iOS 5.1. when running through device and connecting to Studio jetty. I am getting below. </p>
  
  <pre><code>Mar 27 11:23:49 Appsdev-iPhone PushApplication[211] &lt;Warning&gt;: Applications are expected to have a root view controller at the end of application launch
  Mar 27 11:23:49 Appsdev-iPhone PushApplication[211] &lt;Warning&gt;: Web resources integrity test is disabled.
  Mar 27 11:23:49 Appsdev-iPhone kernel[0] &lt;Debug&gt;: launchd[211] Builtin profile: container (sandbox)
  Mar 27 11:23:49 Appsdev-iPhone kernel[0] &lt;Debug&gt;: launchd[211] Container: /private/var/mobile/Applications/5DA837C4-F039-4795-9509-C98383E40C68 [69] (sandbox)
  Mar 27 11:23:49 Appsdev-iPhone PushApplication[211] &lt;Warning&gt;: Multi-tasking -&gt; Device: YES, App: YES
  Mar 27 11:23:51 Appsdev-iPhone PushApplication[211] &lt;Warning&gt;: [LOG] ondeviceready event dispatched
  Mar 27 11:23:51 Appsdev-iPhone PushApplication[211] &lt;Warning&gt;: {
          appVersionPref = "1.0";
          freeSpace = 14291787776;
          wlSkinLoaderChecksum = "(null)";
          wlSkinName = default;
      }
  Mar 27 11:23:51 Appsdev-iPhone PushApplication[211] &lt;Warning&gt;: [LOG] wlclient init started
  Mar 27 11:23:51 Appsdev-iPhone PushApplication[211] &lt;Warning&gt;: [LOG] Read cookies: null
  Mar 27 11:23:51 Appsdev-iPhone PushApplication[211] &lt;Warning&gt;: [LOG] CookieMgr read cookies: {}
  Mar 27 11:23:51 Appsdev-iPhone PushApplication[211] &lt;Warning&gt;: [LOG] Request [http://172.20.10.2:8080/apps/services/api/PushApplication/iphone/init]
  Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] &lt;Warning&gt;: [LOG] Request [login]
  Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] &lt;Warning&gt;: [LOG] Request [http://172.20.10.2:8080/apps/services/api/PushApplication/iphone/init]
  Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] &lt;Warning&gt;: DeviceAuthManager:getWorklightUniqueDeviceId --&gt; returning UUID from the keychain
  Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] &lt;Warning&gt;: [LOG] Request [http://172.20.10.2:8080/apps/services/api/PushApplication/iphone/init]
  Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] &lt;Warning&gt;: [LOG] Clearing notification subscriptions.
  Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] &lt;Warning&gt;: [LOG] Send new server notification token id.
  Mar 27 11:24:12 Appsdev-iPhone SpringBoard[15] &lt;Warning&gt;: 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] &lt;Warning&gt;: [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] &lt;Warning&gt;: [LOG] wlclient connect success
  Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] &lt;Warning&gt;: [LOG] before: app init onSuccess
  Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] &lt;Warning&gt;: [LOG] after: app init onSuccess
  Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] &lt;Warning&gt;: [LOG] wlclient init success
  Mar 27 11:24:12 Appsdev-iPhone PushApplication[211] &lt;Warning&gt;: 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] &lt;Warning&gt;: [ERROR] Error while trying to retrieve device token from the mobile operating system.
  </code></pre>
  
  <p>see attached snapshots.<img src="https://i.stack.imgur.com/pgQSY.png" alt="enter image description here">
  <img src="https://i.stack.imgur.com/mCN3l.png" alt="enter image description here"></p>
  
  <p>The steps to generate APNS:</p>
  
  <ul>
  <li><p>Logged on to Apple Account select App ID ->Configure -> Enable Push</p></li>
  <li><p>Selected Development Push SSL Certificate </p></li>
  <li>Generated a new CSR first and then got a Certificate</li>
  <li>Double clicked the certificate and from Keychain selected this new Certificate and its Private key, and then right-click and Export and saved as
  apns-certificate-sandbox.p12 </li>
  <li><p>copied into Worklight, on the root of App folder at the same level of application-descriptor.xml </p></li>
  <li><p>provided pushSender password and given securityTest</p></li>
  </ul>
  
  <p>Thanks</p>