2015-07-27 13 views
6

Ciao StackOverflow,Swift2.0 HTTP richiesta non funziona

continuo a ricevere questo errore dopo che ho spostato la mia rapida applicazione su Swift2.0:

App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file. 
The resource could not be loaded because the App Transport Security policy requires the use of a secure connection. 

E ho preso uno sguardo al seguente link https://forums.developer.apple.com/thread/5835

e ha aggiunto il seguente codice alla mia info.plist

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

An d ancora non funziona, qualcuno ha una soluzione alternativa?

+0

un'occhiata a questo link @https: //github.com/meteor/meteor/issues/4560 – Kalenda

+1

E questo http://stackoverflow.com/questions/30731785/how-do-i- carico-an-http-url-con-app-trasporto-Security-enabled-in-IO-9. – Kalenda

+0

Ho provato il secondo risultato e ancora non ha funzionato per me – KPath001

risposta

8

suo non è un problema Swift 2.0 sua realtà un problema in cui iOS 9.0iOS 9.0 forze traffico web di andare oltre https impostando il flag di seguito permette http traffico.

È necessario impostare la chiave NSAllowsArbitraryLoads su YES nel dizionario NSAppTransportSecurity nel file .plist. Spero che questo ti aiuti!

enter image description here

+1

Purtroppo Non funziona. E non è correlato a iOS9. –