Api Call error in Xcode 7 / iOS 9 (how to configure application transport protection in plist)

I am using xcode 7 beta. Now I am working with the API. If I use the API in Xcode 6.3, it works fine, but when the same API appears as in the xcode 7 error message, Unable to parse.

here is the api i am using

Please help me. Thanks at Advance

+5
source share
2 answers

In iOS9, Apple added a new feature called Application Transport Security (ATS).

ATS applies best practices during network calls, including the use of HTTPS.

Apple Documentation Before Release:

ATS prevents accidental disclosure, provides secure default behavior, and is easy to accept. You should accept ATS as soon as possible, regardless of whether you are creating a new application or an existing one.

If you are developing a new application, you should use only HTTPS. If you have an existing application, you should use HTTPS as much as you can right now, and create a migration plan for the rest of your application as soon as possible.

Add the link below to your info.plist and then take a look.

<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict> 

Even you can add a specific exception,

 <key>NSAppTransportSecurity</key> <dict> <key>NSExceptionDomains</key> <dict> <key>testdomain.com</key> <dict> <key>NSIncludesSubdomains</key> <false/> <key>NSExceptionAllowInsecureHTTPSLoads</key> <false/> <key>NSExceptionRequiresForwardSecrecy</key> <true/> <key>NSExceptionMinimumTLSVersion</key> <string>TLSv1.2</string> <key>NSThirdPartyExceptionAllowInsecureHTTPSLoads</key> <false/> <key>NSThirdPartyExceptionRequiresForwardSecrecy</key> <true/> <key>NSThirdPartyExceptionMinimumTLSVersion</key> <string>TLSv1.2</string> <key>NSRequiresCertificateTransparency</key> <false/> </dict> ... </dict> </dict> 
+9
source

You can follow these simple steps.

Add the following: info.plist enter image description here

NSAppTransportSecurity
NSAllowsArbitraryLoads
NSAppTransportSecurity
NSAllowsArbitraryLoads
This will help you.

+4
source

All Articles