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

2

7

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

Mend answered 2/4, 2018 at 12:30 Comment(1)
Can share some email-password? so that I can check at my end?Modular
P
7

your info plist hierarchy for transport should be like this

enter image description here

Personify answered 2/4, 2018 at 12:34 Comment(5)
wait i will check.Mend
Instead of this, can you open any url in webview as a test case? If you dont have webview then take a temp webview and try any random url.Personify
hi I tried with webview but again shows same ATS error. please give me source code of info.plist for hierarchyMend
Hey @Personify I fixed this is by doing Project file->info->Custom iOS Target Properties->Add ATS setting with Allow Arbitrary enable instead of adding directly in info.plistMend
Thank you so much.Mend
M
2

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

Modular answered 2/4, 2018 at 12:35 Comment(1)
There is no issue with http:// I tried this URL -> http://linux-training.be/linuxfun.pdf and it works prfect.Personify

© 2022 - 2024 — McMap. All rights reserved.