Skip to main content
Participant
Dec 10, 2015 12:16 PM UTC
Answered

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

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);

This topic is closed to new replies. Start a new post to keep the conversation going.
raffo80Correct answer
Participant
Dec 10, 2015 12:41 PM UTC

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>

4 replies

Known Participant
Dec 14, 2015 2:14 PM UTC

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...

Translate
raffo80Author
Participant
Dec 14, 2015 3:09 PM UTC

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

Translate
raffo80AuthorCorrect answer
Participant
Dec 10, 2015 12:41 PM UTC

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>

Translate
Adobe Employee
Dec 10, 2015 3:41 PM UTC

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

Translate