Highlighted

air 26 StageWebView IOS 7 black screen

Community Beginner ,
May 16, 2017

Copy link to clipboard

Copied

Application crashes when using StageWebView on IOS 7 or lower.

I use this code:

if (StageWebView.isSupported)

{

     var webView:StageWebView = new StageWebView(/* true of false does not matter in this case*/);

     webView.stage = getStage();

     webView.viewPort = getViewPort();

     webView.loadUrl(url);

}

As a result I see black screen.

In debug mode I see exception on the line right after web view's initialization:

[Fault] exception, information=ArgumentError: Error #2004: One of the parameters is invalid.

IOS 7 does not support WKWebKit, so isn't it better to switch to UIWebKit in runtime for old versions?

Like suggests natively:

Xcode 6 + iOS 8 SDK but deploy on iOS 7 (UIWebKit & WKWebKit) - Stack Overflow

TOPICS
Performance issues

Views

481

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

air 26 StageWebView IOS 7 black screen

Community Beginner ,
May 16, 2017

Copy link to clipboard

Copied

Application crashes when using StageWebView on IOS 7 or lower.

I use this code:

if (StageWebView.isSupported)

{

     var webView:StageWebView = new StageWebView(/* true of false does not matter in this case*/);

     webView.stage = getStage();

     webView.viewPort = getViewPort();

     webView.loadUrl(url);

}

As a result I see black screen.

In debug mode I see exception on the line right after web view's initialization:

[Fault] exception, information=ArgumentError: Error #2004: One of the parameters is invalid.

IOS 7 does not support WKWebKit, so isn't it better to switch to UIWebKit in runtime for old versions?

Like suggests natively:

Xcode 6 + iOS 8 SDK but deploy on iOS 7 (UIWebKit & WKWebKit) - Stack Overflow

TOPICS
Performance issues

Views

482

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 16, 2017 0
Contributor ,
May 17, 2017

Copy link to clipboard

Copied

If you want to support iOS 7 (or iOS 8 for that matter) you should be using an earlier version of AIR anyway, since v26 system requirements say iOS 9 and up.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 17, 2017 0
Community Beginner ,
May 18, 2017

Copy link to clipboard

Copied

I think it's incorrect at least because StageWebView.isSupported = true

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 18, 2017 0
Community Beginner ,
May 18, 2017

Copy link to clipboard

Copied

As a temporarily workaround, I wrap this code in try/catch to detect if it's truly supported:

if (StageWebView.isSupported)

{

     var result:Boolean;

     try

     {

          var webView:StageWebView = new StageWebView();

          webView.stage = getStage(); // ios7 throws Exception

          result = true;

     }

     catch(e:Error)

     {

          result = false;

     }

     finally

     {

          webView.dispose();

          webView = null;

          return result;

     }

}

else

{

     return false;

}

But I really hope that stage web view will work using both WK or UI kits

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 18, 2017 0