Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable Allow arbitrary Loads of App Transport Security Setting not working in XCODE 9.2 and iOS 11.2

I used same setting for enabling arbitrary load but now i faced some issues.I used alamofire for json parsing. enter image description here

info.plist settings:

enter image description here

and error is :

enter image description here

like image 935
Vinayak Bhor Avatar asked Apr 02 '18 12:04

Vinayak Bhor


People also ask

How do I add an app to the Transport Security Exception?

If your app still needs to make insecure connections to specific domains, you can configure ATS exceptions for just those domains. Add Exception Domains directly to your app's Info. plist or in the project editor. Navigate to “Signing & Capabilities” and choose the “+ Capability” option.

How would you explain app transport security to a new iOS developer?

App Transport Security (ATS) is a privacy feature introduced in iOS 9. It's enabled by default for new apps and enforces secure connections.

What is app transport security in iOS Swift?

file that specifies the domains with which it needs secure communication. ATS prevents accidental disclosure, provides secure default behavior, and is easy to adopt. You should adopt ATS as soon as possible, regardless of whether you're creating a new app or updating an existing one.

What is NSAllowsArbitraryLoadsInWebContent?

NSAllowsArbitraryLoadsInWebContent. A Boolean value indicating whether all App Transport Security restrictions are disabled for requests made from web views.


2 Answers

your info plist hierarchy for transport should be like this

enter image description here

like image 170
dahiya_boy Avatar answered Nov 15 '22 05:11

dahiya_boy


NSAppTransportSecurity provides the network layer security and only allow http secured urls.

There are 2 ways to solve this:

Case 1:

In your code you are using an unsecure url with http:// replace it with https://, then it will work.

Case 2:

If you don't have ssl enabled url then, allow your url in Exception Domains as:

enter image description here

like image 23
Ankit Jayaswal Avatar answered Nov 15 '22 03:11

Ankit Jayaswal