How can I add NSAppTransportSecurity to my info.plist file?

前端 未结 14 1300
野趣味
野趣味 2020-11-22 12:48

https://developer.apple.com/videos/wwdc/2015/?id=711 @5:55

I can\'t seem to be able to add this to my info.plist. There is no value it. I\'m running XCode Version 7.

相关标签:
14条回答
  • 2020-11-22 13:37

    In mac shell command line , use the following command:

    plutil -insert NSAppTransportSecurity -xml "<array><string> hidden </string></array>" [location of your xcode project]/Info.plist 
    

    The command will add all the necessary values into your plist file.

    0 讨论(0)
  • 2020-11-22 13:41

    Update Answer (after wwdc 2016):

    IOS apps will require secure HTTPS connections by the end of 2016
    

    App Transport Security, or ATS, is a feature that Apple introduced in iOS 9. When ATS is enabled, it forces an app to connect to web services over an HTTPS connection rather than non secure HTTP.

    However, developers can still switch ATS off and allow their apps to send data over an HTTP connection as mentioned in above answers. At the end of 2016, Apple will make ATS mandatory for all developers who hope to submit their apps to the App Store. link

    0 讨论(0)
  • 2020-11-22 13:42
    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSExceptionDomains</key>
        <dict>
            <key>com</key>
            <dict>
                <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
                <true/>
            </dict>
            <key>net</key>
            <dict>
                <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
                <true/>
            </dict>
            <key>org</key>
            <dict>
                <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
                <true/>
            </dict>
        </dict>
    </dict>
    

    This will allow to connect to .com .net .org

    0 讨论(0)
  • 2020-11-22 13:42

    XCODE 8, Swift 3: You need to add a row: **

    "App transport Security Setting"

    ** in the info.plist inside information Property list.

    0 讨论(0)
  • 2020-11-22 13:44

    Xcode 8.2, iOS 10

    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
    </dict>
    
    0 讨论(0)
  • 2020-11-22 13:45

    That wasn't working for me, but this did the trick:

    <key>NSAppTransportSecurity</key>  
         <dict>  
              <key>NSAllowsArbitraryLoads</key><true/>  
         </dict>  
    
    0 讨论(0)
提交回复
热议问题