我为Android和IOS制作了一个AIR App。该应用程序从我的数据库中获取信息并显示它。 (使用URLRequest和加载程序)
var urlReqSearchAll: URLRequest = new URLRequest("http://www.brousse-en-folie.com/cinenc/searchMovie4.php");
var loader5:URLLoader = new URLLoader();
它还将网站中的图像保存到手机中:
uiloader1.source = http://www.cinecity.nc/images/image.jpg;
uiloader1.addEventListener(Event.COMPLETE, movie1Complete);
function movie1Complete(event:Event):void {
movieImage1 = movieImage1.resolvePath("movie1Image.jpg");
chooseTheOne = movieImage1;
stream.load(new URLRequest(products[0].movieimage));
stream.addEventListener(Event.COMPLETE, writeComplete);
uiloader1.removeEventListener(Event.COMPLETE, movie1Complete);
}
function writeComplete(evt:Event):void {
var fileStream:FileStream = new FileStream();
var fileData:ByteArray = new ByteArray();
stream.readBytes(fileData,0,stream.bytesAvailable);
fileStream.openAsync(chooseTheOne, FileMode.UPDATE);
fileStream.writeBytes(fileData,0,fileData.length);
fileStream.close();
}
在Android设备上一切正常,但在IOS上我的应用程序似乎无法检索信息。
我在IOS的XML文件中添加了这个:
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>cocogeek.nc</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
<key>brousse-en-folie.com</key>
<dict>
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
<key>cinecity.nc</key>
<dict>
<key>NSThirdPartyExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
但即便如此,它也行不通。
知道我忘记了什么吗?