• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
1

No network in iOS

Engaged ,
Feb 23, 2016 Feb 23, 2016

Copy link to clipboard

Copied

I'm recompiling an iOS app with Animate CC and Adobe Air SDK 20.0.0.260 and the app cannot access the network.

This is pretty serious and completely breaks my app. I have tried it in iOS 9.1 and 9.2.1 on 2 different devices. And yes the device is connected to Wifi.

The code works fine when testing on computer. When debugging on device URLMonitor reports no network available and URLLoader event HTTPStatusEvent.HTTP_RESPONSE_STATUS never fires (which makes sense since the app thinks it has no network).

I've tried using a previous version of Adobe Air SDK but Animate CC won't let me add previous versions.

Screen Shot 2016-02-23 at 10.56.24 AM.png

I'm installing the previous version of Flash Pro and will report back.

TOPICS
Development

Views

2.0K

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
community guidelines

correct answers 1 Correct answer

Adobe Employee , Feb 23, 2016 Feb 23, 2016

Hi,

This is not a AIR bug but this is due to new feature introduced on iOS 9+ devices.

Please add the following in your app's iPhone info-additions and check if the issue is solved.

you can replace www.abcd.com with the url you are trying to access.

<key>NSAppTransportSecurity</key>

<dict>

<key>NSExceptionDomains</key>

<dict>

<key>www.abcd.com</key>

<dict>

<!--Include to allow subdomains-->

<key>NSIncludesSubdomains</key>

<true/>

<!--Include to allow HTTP requests-->

<key>NSTemporaryExceptionAllowsInsecureHT

...

Votes

Translate

Translate
Engaged ,
Feb 23, 2016 Feb 23, 2016

Copy link to clipboard

Copied

So I installed the last version of Flash Pro and was able to get network on device by compiling with SDK 19.

Compiled with SDK 20.0.0.206 = No network

Compiled with SDK 19.0.0.180 = Network OK

I think it's fair to say this is Adobe Air 20 bug.

Votes

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
community guidelines
Adobe Employee ,
Feb 23, 2016 Feb 23, 2016

Copy link to clipboard

Copied

Hi,

This is not a AIR bug but this is due to new feature introduced on iOS 9+ devices.

Please add the following in your app's iPhone info-additions and check if the issue is solved.

you can replace www.abcd.com with the url you are trying to access.

<key>NSAppTransportSecurity</key>

<dict>

<key>NSExceptionDomains</key>

<dict>

<key>www.abcd.com</key>

<dict>

<!--Include to allow subdomains-->

<key>NSIncludesSubdomains</key>

<true/>

<!--Include to allow HTTP requests-->

<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>

<true/>

<!--Include to specify minimum TLS version-->

<key>NSTemporaryExceptionMinimumTLSVersion</key>

<string>TLSv1.1</string>

</dict>

</dict>

</dict>

Votes

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
community guidelines
Engaged ,
Feb 23, 2016 Feb 23, 2016

Copy link to clipboard

Copied

If that's the case why does it work when compiling with SDK 19 without modifying info-additions ?

Votes

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
community guidelines
Adobe Employee ,
Feb 23, 2016 Feb 23, 2016

Copy link to clipboard

Copied

Because, from SDK 20 we started supporting iOS 9.0. And the above applies to iOS 9 +

Please test the above suggestions and confirm if it works.

Votes

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
community guidelines
Adobe Employee ,
Feb 23, 2016 Feb 23, 2016

Copy link to clipboard

Copied

Also, Can you please confirm if you are trying with 20.0.260 build?

Votes

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
community guidelines
Enthusiast ,
Feb 24, 2016 Feb 24, 2016

Copy link to clipboard

Copied

Roshan, woudn't it be enough with just adding:

<key>NSAppTransportSecurity</key>

  <dict>

    <key>NSAllowsArbitraryLoads</key>

    <true/>

  </dict>

I have an app that does a few http requests and by adding just these lines in the info-additions, I get it to work in AIR 20+.

Or will Apple require us to specify the domains?

Votes

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
community guidelines
Adobe Employee ,
Feb 24, 2016 Feb 24, 2016

Copy link to clipboard

Copied

Hi @Lars Laborious,

You can definitely add it , but this will enable your app's connection to all http URL's and Apple does not require us to specify domains ( as per my knowledge).


However, It is always advisable to add the known http url's in your xml such that it communicates only to the url's that developer knows.

-Roshan

Votes

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
community guidelines
Enthusiast ,
Feb 24, 2016 Feb 24, 2016

Copy link to clipboard

Copied

Yes, that sounds reasonable.

I guess, though, enabling connection to all http URL's (as prior to AIR 20) would ease the job using mobile ad networks.

Votes

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
community guidelines
New Here ,
Mar 02, 2016 Mar 02, 2016

Copy link to clipboard

Copied

Hi Roshan,

I was building for iOS with Animate CC and AIR 20.0.0.260 right now. Before trying the NSAppTransportSecurity keys, it gets a #2032 stream error every time. However, when the build target in document panel is changed to original AIR 20.0 for iOS, the network is working correctly. After trying the NSAllowsArbitraryLoads key on AIR 20.0.0.260 it also works fine. The problem is, when using NSExceptionDomains on AIR 20.0.0.260 it doesn't work for me, but maybe it's because I'm using it with static IP address instead of a domain. Hey thanks!


-JingJi

Votes

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
community guidelines
Community Beginner ,
Jun 29, 2016 Jun 29, 2016

Copy link to clipboard

Copied

I had this problem as well, and can confirm that adding NSAllowsArbitraryLoads key fixed it (much to my relief).

If you are still getting an error, it could be due to trying to access an http site, as apple now seems to have stricter guidelines on this so adding SSL is another step.

Here is some info related to the server security requirements that I found: https://medium.com/@Mrugraj/app-transport-security-b7910c4fc70f#.xba5jyc3u

Votes

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
community guidelines
Engaged ,
Jun 30, 2016 Jun 30, 2016

Copy link to clipboard

Copied

LATEST

jingji_ wrote:

I'm using it with static IP address instead of a domain. Hey thanks!

If this is a static IPv4 address, are you planning on using that in production or is this only for development testing?

Just mentioning that you could run into another Apple hurdle if you need to keep using static IPv4 addresses as Apple requires apps also support working in an IPv6-only network environment now, so you could get an app rejection if you plan on keeping static IPv4 addresses when Apple verifies it with IPv6-only network.

It would be best if you can avoid the IPv4 static addresses even in development so you can also test the app yourself in IPv6-only networks too.

Votes

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
community guidelines