1 Reply Latest reply on May 31, 2012 12:42 PM by BennoFlo

    StageWebView and iOS - LocationChangeEvent

    BennoFlo

      Hi All,

       

      I've run into a cross platform issue. Below is my current code for location change handling within my StageWebView.

       

      webView.addEventListener(LocationChangeEvent.LOCATION_CHANGE, handleHrefClick);

      webView.addEventListener(LocationChangeEvent.LOCATION_CHANGING, handleHrefClick);

       

      if(Capabilities.version.indexOf("IOS") != -1){

              webView.addEventListener(Event.COMPLETE, handleHrefClickComplete);

      }

       

      What I use this for is clicking links within my HTML. For Android, whenever the click occurs, a LocationChangingEvent occurs.

       

      However, in iOS, I get no event. I just receive the following error:

       

      The protocol is not supported.: <myProtocol>://blah/#<ID>

       

      As you can see, I tried capturing Event.COMPLETE for iOS, but to no avail. What is the proper way to capture location change events for iOS?

       

      More Notes:

      The reason I have custom URLs that are linked up is to capture the StageWebView's location change, prevent default interaction (going to a custom URL), and parsing the ID from this URL. Then I use the ID to call some javascript functions and do cool things within my StageWebView.

       

      All helpful comments are appreciated.

       

      Thanks,

      Ben

        • 1. Re: StageWebView and iOS - LocationChangeEvent
          BennoFlo Level 1

          I fixed the above issue. In this case, the iPhone is reporting an Event.ERROR whenever the unsupported protocol is used. I can parse this error message for my ID and get my desired result.

           

          However, if the protocol was supported and clicked via HREF within a StageWebView, does anyone know the resulting event?

           

          I'll do some testing a bit later for more information.

          1 person found this helpful