Adob​​e Air无法连接到iOS10上的服务器

问题描述:

我有2年的Appstore应用程序。 我使用Adobe AIR开发的。Adob​​e Air无法连接到iOS10上的服务器

在iOS10上我的应用程序无法正常工作。无法连接到http链接。

我调试并从连接中得到错误: 错误#2044:未处理ioError :.文本=错误#2032:流错误。网址:http://api.website.net/check.php

我用HTTPStatusEvent.HTTP_STATUS为了解任何解决方案,它提供了0

任何方法来解决?

我的代码:

var urlReq:URLRequest = new URLRequest ("http://api.website.net/check.php");    
urlReq.method = URLRequestMethod.POST;   
var urlVars:URLVariables = new URLVariables();   
urlVars.user_id = Main.instance.userID;  
urlReq.data = urlVars; 


var loader:URLLoader = new URLLoader (urlReq); 
loader.addEventListener(Event.COMPLETE, onCreditComplete); 


loader.addEventListener(HTTPStatusEvent.HTTP_RESPONSE_STATUS, httpStatusHandler); 
loader.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler); 


loader.dataFormat = URLLoaderDataFormat.VARIABLES; 
loader.load(urlReq); 
+1

可能是_using非'https' link_可能是__非64位app_。苹果对应用程序的期望已经改变。我无法回答你,只是在等待答案时进行调查。例如,测试URLRequest用于从'http' url加载一些文本文件,并从'https' url加载。如果两者均可在iOS测试中使用,那么将会消除一个问题等。 –

+0

我发现有关服务器要求的错误。 找到一个https链接来尝试这项工作。但我的http链接不工作。有些论坛说你的服务器必须支持iPv6。 你知道哪些需求需要使用iOS10吗? –

听起来像它的相关的iOS应用程序传输的安全设置。

要启用http请求,你要么需要定义应用程序描述符域为例外:

<key>NSAppTransportSecurity</key> 
<dict> 
    <key>NSExceptionDomains</key> 
    <dict> 
     <key>api.website.net</key> 
     <dict> 
      <key>NSExceptionAllowsInsecureHTTPLoads</key> 
      <true/> 
      <key>NSIncludesSubdomains</key> 
      <true/> 
     </dict> 
    </dict> 
</dict> 

或添加全局忽略安全设置:

<key>NSAppTransportSecurity</key> 
<dict> 
    <key>NSAllowsArbitraryLoads</key> 
    <true/> 
</dict> 

这些设置应该添加到您的应用程序描述符的iPhone设置中的InfoAdditions节点中:

<iPhone> 
    <InfoAdditions><![CDATA[ 
     <key>UIDeviceFamily</key> 
     <array> 
      <string>1</string> 
      <string>2</string> 
     </array> 

     <!-- Add the above settings here --> 

    ]]></InfoAdditions> 
    <requestedDisplayResolution>high</requestedDisplayResolution> 
    <Entitlements> 
     <![CDATA[ 
     ]]> 
    </Entitlements> 
</iPhone> 
+0

谢谢,这解决了问题;) –