Highlighted

URLLoader error #2032 with AIR 20 (AIR 19 works)

Community Beginner ,
Dec 10, 2015

Copy link to clipboard

Copied

Hello, I've updated from Flex 4.14.0 + AIR 19 build 143 to Flex 4.14.0 + AIR 20 build 206, now my code with URLLoader on a HTTP connection without SSL doesn't work on iOS (error #2032).

The device I'm testing on is an iPad Mini Retina with iOS 9.2.

The url is reachable with Safari.

Snippet is the following:

var url:String = "http://www.falcosoft.it/catalogo/catalogo.xml";

var onComplete:Function = function(event:Event):void {

  // this code doesn't get called

  loader.removeEventListener(Event.COMPLETE, onComplete);

};

var onIOError:Function = function(event:IOErrorEvent):void {

  // the program always calls onIOError with error #2032: Stream error

  loader.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);

};

var onSecurityError:Function = function(event:SecurityErrorEvent):void {

  loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);

};

var request:URLRequest = new URLRequest(url);

request.method = URLRequestMethod.GET;

var loader:URLLoader = new URLLoader();

loader.dataFormat = URLLoaderDataFormat.BINARY;

loader.addEventListener(Event.COMPLETE, onComplete);

loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);

loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);

loader.load(request);

Correct answer by raffo80 | Community Beginner

My bad.

I didn't see the section in the FAQ explaining that Apple is limiting access to unsecured web connections.

I'd like not to delete the question because searching for the problem on search engines didn't lead to recent answers.

I will try to add the following manifest addition to bypass the problem.

<iPhone>

<InfoAdditions>

<![CDATA[

<key>NSAppTransportSecurity</key>

<dict>

<key>NSAllowsArbitraryLoads</key><true/>

</dict>

]]>

</InfoAdditions>

</iPhone>

TOPICS
Air beta

Views

3.6K

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

URLLoader error #2032 with AIR 20 (AIR 19 works)

Community Beginner ,
Dec 10, 2015

Copy link to clipboard

Copied

Hello, I've updated from Flex 4.14.0 + AIR 19 build 143 to Flex 4.14.0 + AIR 20 build 206, now my code with URLLoader on a HTTP connection without SSL doesn't work on iOS (error #2032).

The device I'm testing on is an iPad Mini Retina with iOS 9.2.

The url is reachable with Safari.

Snippet is the following:

var url:String = "http://www.falcosoft.it/catalogo/catalogo.xml";

var onComplete:Function = function(event:Event):void {

  // this code doesn't get called

  loader.removeEventListener(Event.COMPLETE, onComplete);

};

var onIOError:Function = function(event:IOErrorEvent):void {

  // the program always calls onIOError with error #2032: Stream error

  loader.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);

};

var onSecurityError:Function = function(event:SecurityErrorEvent):void {

  loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);

};

var request:URLRequest = new URLRequest(url);

request.method = URLRequestMethod.GET;

var loader:URLLoader = new URLLoader();

loader.dataFormat = URLLoaderDataFormat.BINARY;

loader.addEventListener(Event.COMPLETE, onComplete);

loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);

loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);

loader.load(request);

Correct answer by raffo80 | Community Beginner

My bad.

I didn't see the section in the FAQ explaining that Apple is limiting access to unsecured web connections.

I'd like not to delete the question because searching for the problem on search engines didn't lead to recent answers.

I will try to add the following manifest addition to bypass the problem.

<iPhone>

<InfoAdditions>

<![CDATA[

<key>NSAppTransportSecurity</key>

<dict>

<key>NSAllowsArbitraryLoads</key><true/>

</dict>

]]>

</InfoAdditions>

</iPhone>

TOPICS
Air beta

Views

3.6K

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
Dec 10, 2015 0
Community Beginner ,
Dec 10, 2015

Copy link to clipboard

Copied

My bad.

I didn't see the section in the FAQ explaining that Apple is limiting access to unsecured web connections.

I'd like not to delete the question because searching for the problem on search engines didn't lead to recent answers.

I will try to add the following manifest addition to bypass the problem.

<iPhone>

<InfoAdditions>

<![CDATA[

<key>NSAppTransportSecurity</key>

<dict>

<key>NSAllowsArbitraryLoads</key><true/>

</dict>

]]>

</InfoAdditions>

</iPhone>

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...
Dec 10, 2015 0
Adobe Employee ,
Dec 10, 2015

Copy link to clipboard

Copied

Hi,

App Transport Security (ATS) is being introduced from Apple in iOS9, which doesn’t allow unsecure connections between App and Web services. Due to this change all the connections which are made to unsecure web sites via Loader, URLLoader will discontinue and not work due to App Transport Security. Please specify exceptions to the default behavior by adding keys to InfoAdditions tag of application descriptor of your app.  

<key>NSAppTransportSecurity</key>

  <dict>

  <key>NSAllowsArbitraryLoads</key><true/>

  </dict>

Same has been mentioned in : http://fpdownload.macromedia.com/pub/labs/flashruntimes/shared/air20_flashplayer20_releasenotes.pdf

Roshan

Adobe AIR

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...
Dec 10, 2015 1
Explorer ,
Dec 14, 2015

Copy link to clipboard

Copied

Is there a difference with ad hoc builds and release builds regarding the loading perhaps? My ad hoc build seems to load my content just fine without the ATS additions into the app descriptor...

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...
Dec 14, 2015 0
raffo80 LATEST
Community Beginner ,
Dec 14, 2015

Copy link to clipboard

Copied

My ad hoc build did NOT load any http content without the fix

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...
Dec 14, 2015 0