ICEmobile
  1. ICEmobile
  2. MOBI-1125

MobileShowcase: cloudPush demo, "Register for Cloud Push" button doesn't always display

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE 1.3.1.GA
    • Fix Version/s: EE 1.3.1.GA_P03
    • Component/s: Faces
    • Labels:
      None
    • Environment:
      ICEmobile EE 1.3.1.GA_P01 mobile showcase sample

      Description

      When using the ICEmobile Showcase CloudPush demo, the "Register for Cloud Push" button is not displayed if the user has accessed another demo previously in the session that uses the BridgeIt app.

      I'm getting the same results on my iphone 5 / iOS 8.1.2 as previously.

      1. Start http://mobileshowcase.icesoft.org/mobileshowcase/showcase.jsf demo
      2. Use camera demo (works).
      3. Load Cloud Push demo.
      4. Note that the "Register for Cloud Push" button is not displayed on the page, thus, there is no way to register for Cloud Push, and a Priority Push will not generate a native notification.

      However, if you do not use another demo that accesses the BridgeIt app., but instead immediately load the Cloud Push demo, the "Register for Cloud Push" button will be visible, and clicking it, and then the Priority Push button will result in a native notification being received if the browser is closed prior to the Priority Push being received.

        Issue Links

          Activity

          Hide
          Ken Fyten added a comment - - edited

          Note that this component should be settings the button state based on asking bridgeit.js if the viewport is already registered for cloud push or not. If this API is unreliable or none-existing in bridgeit.js, we should add it for the upcoming bridgeit 1.0.6 release. Any improvements made in this regard should also be carried forward to the IF 4 mobi:cloudPush component under a new JIRA.

          Show
          Ken Fyten added a comment - - edited Note that this component should be settings the button state based on asking bridgeit.js if the viewport is already registered for cloud push or not. If this API is unreliable or none-existing in bridgeit.js, we should add it for the upcoming bridgeit 1.0.6 release. Any improvements made in this regard should also be carried forward to the IF 4 mobi:cloudPush component under a new JIRA.
          Hide
          Arturo Zambrano added a comment -

          r44716: Committed possible fix to the icemobile trunk. Removed condition to avoid rendering the mobi:registerCloudPush component based on server-side detection that cloud push has been registered; added simple script to determine cloud push registration in the client by calling bridgeit.isRegistered().

          It seems like the component code already had the intention of only rendering the "Register for Cloud Push" button if cloud push hadn't been registered yet. However, it was using a server-side mechanism that didn't seem to work correctly. The logic to determine whether cloud push has been registered or not has now been moved to the client side, by calling bridgeit.isRegistered(), and if true, the button is hidden.

          Testing notes: please test this fix on iOS, as I couldn't test it appropriately on Android.

          Show
          Arturo Zambrano added a comment - r44716: Committed possible fix to the icemobile trunk. Removed condition to avoid rendering the mobi:registerCloudPush component based on server-side detection that cloud push has been registered; added simple script to determine cloud push registration in the client by calling bridgeit.isRegistered(). It seems like the component code already had the intention of only rendering the "Register for Cloud Push" button if cloud push hadn't been registered yet. However, it was using a server-side mechanism that didn't seem to work correctly. The logic to determine whether cloud push has been registered or not has now been moved to the client side, by calling bridgeit.isRegistered(), and if true, the button is hidden. Testing notes: please test this fix on iOS, as I couldn't test it appropriately on Android.
          Hide
          Ken Fyten added a comment -

          Also applied this commit to the ICEmobile 1.3.1.GA_P03 tag (revision 44718).

          Show
          Ken Fyten added a comment - Also applied this commit to the ICEmobile 1.3.1.GA_P03 tag (revision 44718).
          Hide
          Arturo Zambrano added a comment -

          r44758: added callback function to remove the mobi:registerCloudPush button when returning from bridgeit after successfully registering for cloud push.

          So, I could confirm by accessing the public demo that the logic behind bridgeit.isRegistered() is correct and it works as we expect. For example, after initializing another component that uses bridgeit, like mobi:camera, bridgeit.isRegistered() will return false, as expected, because cloud push hasn't been registered. Only after clicking the mobi:registerCloudPush button bridgeit.isRegistered() will return true and the button will be hidden.

          Testing notes: Unfortunately, I couldn't test this last fix completely by myself, as there seems to be a problem with my router and I cannot access servers running on my laptops from my Android device. I just verified that the new javascript is correct, so please test this new fix on Android and iOS.

          Show
          Arturo Zambrano added a comment - r44758: added callback function to remove the mobi:registerCloudPush button when returning from bridgeit after successfully registering for cloud push. So, I could confirm by accessing the public demo that the logic behind bridgeit.isRegistered() is correct and it works as we expect. For example, after initializing another component that uses bridgeit, like mobi:camera, bridgeit.isRegistered() will return false, as expected, because cloud push hasn't been registered. Only after clicking the mobi:registerCloudPush button bridgeit.isRegistered() will return true and the button will be hidden. Testing notes: Unfortunately, I couldn't test this last fix completely by myself, as there seems to be a problem with my router and I cannot access servers running on my laptops from my Android device. I just verified that the new javascript is correct, so please test this new fix on Android and iOS.
          Hide
          Arturo Zambrano added a comment -

          r44759: committed fix to tag

          Show
          Arturo Zambrano added a comment - r44759: committed fix to tag
          Hide
          Ken Fyten added a comment -

          Button seems to be working correctly on Android now.

          However, on iOS, after you click the register for cloud push button, it goes to bridgeit and comes back, but the button is still showing and priority push doesn't work. If you click "Register..." again, it goes to bridgeit and comes back, the button hides correctly this time, and priority push now works.

          We should add some JS console logging to show what the relevant values are when it returns from the registration step in the component to see if the state issue is in the button or the bridgeit.js or app.

          Show
          Ken Fyten added a comment - Button seems to be working correctly on Android now. However, on iOS, after you click the register for cloud push button, it goes to bridgeit and comes back, but the button is still showing and priority push doesn't work. If you click "Register..." again, it goes to bridgeit and comes back, the button hides correctly this time, and priority push now works. We should add some JS console logging to show what the relevant values are when it returns from the registration step in the component to see if the state issue is in the button or the bridgeit.js or app.
          Hide
          Ken Fyten added a comment -

          The remaining issues iOS is caused by a BridgeIt app. bug, see MOBI-1137.

          Marking resolved.

          Show
          Ken Fyten added a comment - The remaining issues iOS is caused by a BridgeIt app. bug, see MOBI-1137 . Marking resolved.

            People

            • Assignee:
              Arturo Zambrano
              Reporter:
              Ken Fyten
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: