我將此添加到我的應用程序Info.plist文件退出ATS的:禁用應用程序傳輸安全,從HTTP訪問仍然被阻塞
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
,當我嘗試做從GET請求仍然得到這個錯誤我的HTTP資源(具有對服務器無法控制):
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.
我的完整plist文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key><true/>
</dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.owlpixel.xxxxx</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
ATS應該被禁用,爲什麼它仍然阻止我?有任何想法嗎?
檢查此問題,似乎是同樣的問題,檢查第一個解決方案是否可以幫助您http://stackoverflow.com/questions/32761042/swift-app-transport-security-has-blocked-a-cleartext-http-resource – UlyssesR
我也嘗試了「NSExceptionDomains」並添加了我的域 - 相同的結果 – mindbomb
您是否嘗試過所有經典的「項目神祕清理」,cmd + shfit + k /派生數據等等? – UlyssesR