Search code examples
iosiphonexcodeios8ios9

With Xcode 7 testing an iOS 9 app is unable to obtain data from a http request


I am developing an application in iOS. For my development I am using Xcode beta7. Before, I used to test my app in my mobile with iOS 8.4 after updating to iOS 9, I can't install the same app in my mobile. Please give me some suggestions. Big thanks!


Solution

  • Add this line to your .plist file: enter image description here

    Source:

    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSExceptionDomains</key>
        <dict>
            <key>yoursite.com</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
                <true/>
            </dict>
        </dict>
    </dict>
    

    Workaround, edited because shouldn't be used. Secure your data