dimanche 5 mars 2017

Try to access third party website in IOS AIR app (as3)

I've made an AIR App for Android and IOS. The app is taking infos from my database and displays it. (with URLRequest and loader)

var urlReqSearchAll: URLRequest = new URLRequest("http://ift.tt/2lPRweH");
var loader5:URLLoader = new URLLoader();

It also saves images from a website into the phone :

uiloader1.source = http://ift.tt/2mcahvz;
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(); 
        } 

Everything is working fine on Android devices but on IOS my app seems to not retrieve the information.

I've added in the XML file of the IOS this :

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

But even with that, it doesn't work.

Any idea what I've forgot ?

Aucun commentaire:

Enregistrer un commentaire