2016-03-06 64 views
0

我将此添加到我的应用程序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应该被禁用,为什么它仍然阻止我?有任何想法吗?

+1

检查此问题,似乎是同样的问题,检查第一个解决方案是否可以帮助您http://stackoverflow.com/questions/32761042/swift-app-transport-security-has-blocked-a-cleartext-http-resource – UlyssesR

+0

我也尝试了“NSExceptionDomains”并添加了我的域 - 相同的结果 – mindbomb

+0

您是否尝试过所有经典的“项目神秘清理”,cmd + shfit + k /派生数据等等? – UlyssesR

回答

0

尝试寻找是否有你很多的.plist文件的Xcode项目(或Workspace)。

我有同样的问题,这是通过查找我的工作区所有Info.plist文件,并添加NSAppTransportSecurity逻辑来负责外部(http://)调用.plist文件来解决。

相关问题