類似錯誤訊息:
- 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.
- NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)
- FBSDKLog: WARNING: FBSDK secure network request failed. Please verify you have configured your app for Application Transport Security compatibility described at https://developers.facebook.com/docs/ios/ios9
此外,對於判斷 URL Scheme 也是個問題,例如常見判斷 JB 的方式:
[[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"cydia://package/com.example.package"]]
也有類似的資源限制問題:
-canOpenURL: failed for URL: "cydia://package/com.example.package" - error: "This app is not allowed to query for scheme cydia"
這時也得設定 LSApplicationQueriesSchemes 參數來處理,設定完會變成:
-canOpenURL: failed for URL: "cydia://package/com.example.package" - error: "(null)"
請問一下要怎麼解決這個問題呢
回覆刪除在 Info.plist 中,添加一個 NSAppTransportSecurity (Dictionary) ,裡頭在添加一個 NSAllowsArbitraryLoads (Boolean) 為 YES 即可。
回覆刪除http://stackoverflow.com/questions/31254725/transport-security-has-blocked-a-cleartext-http
回覆刪除請看圖片。