vishal vishal - 1 month ago 7
Objective-C Question

App Transport Security policy error while connecting to server with IP address

I have an app which connects to a server to call APIs using IP address, I don't have a domain associated with it. I have tried following solution in plist.info file, but still i receive same error.

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


I want to know how i can escape this security policy in this case, this is our development server , we will associate domain name later while submitting app to store, I want to be able to test and develop.


NSLocalizedDescription=The resource could not be loaded because the App Transport Security policy requires the use of a secure connection

Answer

It looks like you can't use hard coded IP Addresses. Please refer to this answer for more info.

Hard-coded IP address wont work in iOS9. I also faced the same issue. Tried all permutations & combinations of available solutions. Finally, had to use a proper domain name.

Comments