Skip to main content
Inspiring
November 9, 2018
Question

Why is URLLoader in Adobe Air (iOS App) no more working?

  • November 9, 2018
  • 3 replies
  • 1155 views

Hi,

I've been working on a project a few months ago. Back then I was able to load data via URLLoader to my Game (I made it for iOS, Android and Flash(Web)). Now I wanted to update my Game but it's no longer working. I'm always getting an IOError

ioErrorHandler noweb[IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL: http://www.questioneverything.de/frei3/" errorID=2032]

Why is that? What changed?

Can anybody help please?

Best regards

Jan

  public var link:String = "http://www.questioneverything.de/frei3/";

  public var hs:String = "frei3_hs.php";

  var re:URLRequest;

  var vars:URLVariables;

  var loader:URLLoader;

  var resultVars:URLVariables;

  re = new URLRequest(link + hs);

  loader = new URLLoader  ;

  loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);

  loader.addEventListener(Event.OPEN,oeffnen);

  loader.addEventListener(Event.COMPLETE,fertig);

  loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);

  vars = new URLVariables ();

  vars.g_zahl = g_zahl;

  resultVars = new URLVariables ();

  re.data = vars;

  re.method = URLRequestMethod.POST;

  loader.load(re);

This topic has been closed for replies.

3 replies

Inspiring
November 13, 2018

The temporary fix is below. Apple has not stated when they will disallow bypassing of HTTPS, which is what this code does.

This should be added within the ,iPhone. tags as shown in manifest document your-app.xml in your project root directory.

    <iPhone>

        <assetsCar>Assets.car</assetsCar>

        <requestedDisplayResolution>high</requestedDisplayResolution>

        <InfoAdditions><![CDATA[

     <key>CFBundleIconName</key>

            <string>AppIcon</string>

        <key>UIDeviceFamily</key>

    <array><string>1</string></array>

    <key>NSAppTransportSecurity</key>

  <dict>

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

  </dict>

]]></InfoAdditions>

    </iPhone>

Colin Holgate
Inspiring
November 13, 2018

I'm working on an update to an app that plays videos that are online, at http addresses. I tried the NSAllowsArbitraryLoads line, but may not have included the NSAppTransportSecurity part. It didn't fix the videos (probably would have done with the NSAppTransportSecurity part included). Fortunately the client has a certificate on that site now, so I just switched my code to use https instead.

Inspiring
November 9, 2018

search the forum for the similar question
for ex: URLLoader error #2032 with AIR 20 (AIR 19 works)

in short iOS allow only to load HTTPS URL and you try to load over HTTP
either support HTTPS on your server or add in your manifest the NSAppTransportSecurity key

dasessigAuthor
Inspiring
November 11, 2018

Thanks a lot for the reply! ASWC & @zwetan_uk

I've seen the Post above, but it didn't solve the Problem. Not for the iOS Version and not for the Flash version.

You can check the Flashversion of the game here: Quest for Truth

In the upper left corner is a small  Icon that opens the Highscore List... ... which is no longer loaded / working. It just shows the mask for the Hisghore List as it is not able to access the .php file..

... so the only way to make this work again (for iOS, Flash etc) is to change my Website/Server to HTTPS, correct?

And then it should be working fine again (same AS§ Script etc) and also in iOS, Android, Flash and in the Future, right!?

Inspiring
November 12, 2018

well... if I try opening this page

http://www.questioneverything.de/frei3/frei3_hs.php

I obtain a 500 error with chrome

here the details when I try with cURL

$ curl -v http://www.questioneverything.de/frei3/frei3_hs.php

*   Trying 2a01:488:42:1000:50ed:840f:7f:709b...

* TCP_NODELAY set

* Connected to www.questioneverything.de (2a01:488:42:1000:50ed:840f:7f:709b) port 80 (#0)

> GET /frei3/frei3_hs.php HTTP/1.1

> Host: www.questioneverything.de

> User-Agent: curl/7.60.0

> Accept: */*

>

< HTTP/1.1 500 Internal Server Error

< Date: Mon, 12 Nov 2018 00:36:36 GMT

< Content-Type: text/html

< Content-Length: 0

< Connection: keep-alive

< Server: Apache

<

* Connection #0 to host www.questioneverything.de left intact

with that I would say something is wrong on the server-side


your code

loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);

should catch that 500 with AIR (not with Flash)

I would start to fix that first but the HTTPS is also a thing under iOS so everything said above is still valid

Inspiring
November 9, 2018

You can't use http protocol anymore, Ios only allows https. There are workarounds (permissions) but they won't work forever.