Skip to content

Instantly share code, notes, and snippets.

@nvanselow
Created September 29, 2015 00:32
Show Gist options
  • Save nvanselow/eda7214334849b9e6225 to your computer and use it in GitHub Desktop.
Save nvanselow/eda7214334849b9e6225 to your computer and use it in GitHub Desktop.
Allow local development servers without http in an iOS Ionic app.

Allowing Local Development Server without HTTPS

New rules cause a Transport Security Error in XCode when trying to test an app using an emulator that connects to a localhost without an SSL certificate. You can add the following code to allow testing on a development server.

Add the following to the platforms/ios/yourappname/YourAppName-Info.plist file

<key>NSAppTransportSecurity</key>
    <dict>
      <key>NSExceptionDomains</key>
      <dict>
        <key>localserver.dev</key>
        <dict>
          <key>NSExceptionAllowsInsecureHTTPLoads</key>
          <true/>
        </dict>
      </dict>
    </dict>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment