Skip to main content
Participant
April 18, 2016
Answered

Loading a StageWebView shows up blank on my iDevice

  • April 18, 2016
  • 2 replies
  • 620 views

I'm developing an iOS app on Animate CC. I tried using StageWebView class within the app in order to display a webpage but despite all my efforts on following the documents to the letter I was unable to view the webpage neither on my iPad nor on my iPhone. It works perfectly fine on AIR debug launcher (test movie) but when I run it on either of the devices, all I see is a blank white rectangular. I wonder whether this class has no iOS support or there is some other reason. I would be pleased if someone could assist me on this matter.

Code:

import flash.net.URLRequest;

import flash.media.StageWebView;

import flash.geom.Rectangle;

var webView:StageWebView;

               

click_openWeb.addEventListener(MouseEvent.CLICK, click_openWeb);

function click_openWeb(event:MouseEvent):void

{

        if(webView!=null){

        return;

        }

            

     webView=new StageWebView();

     webView.stage=this.stage;

     webView.viewPort=new Rectangle(0, 200, stage.stageWidth, 400);

     webView.loadURL("http://google.com");

}

closeWeb.addEventListener(MouseEvent.CLICK, click_closeWeb);

function click_closeWeb(event: MouseEvent): void {

        if(webView==null){

        return;

        }

     webView.viewPort=null;

     webView.dispose();

     webView=null;

}

This topic has been closed for replies.
Correct answer zer0-hour

I added some keys to InfoAdditions in my application descriptor file:

<key>NSAppTransportSecurity</key>

<dict>

  <key>NSAllowsArbitraryLoads</key>

  <true/>

</dict>

Now it works perfectly

2 replies

zer0-hourAuthorCorrect answer
Participant
April 18, 2016

I added some keys to InfoAdditions in my application descriptor file:

<key>NSAppTransportSecurity</key>

<dict>

  <key>NSAllowsArbitraryLoads</key>

  <true/>

</dict>

Now it works perfectly

Colin Holgate
Inspiring
April 18, 2016

I imagine you've tried other URLs, but in case not, try using https://www.google.com instead of http://www.google.com. The http one gets sent through a redirect, and maybe that has a problem with StageWebView.