Tried to run my existing app on iOS9 but getting failure while using AFURLSessionManager
.
__block NSURLSessionDataTask *task = [self.sessionMana
I have solved it with adding some key in info.plist. The steps I followed are:
I Opened my project's info.plist file
Added a Key called NSAppTransportSecurity as a Dictionary.
Added a Subkey called NSAllowsArbitraryLoads as Boolean and set its value to YES as like following image. enter image description here
Clean the Project and Now Everything is Running fine as like before.
Ref Link: https://stackoverflow.com/a/32609970
I found solution from here. And its working for me.
Check this, it may help you.
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>myDomain.com</key>
<dict>
<!--Include to allow subdomains-->
<key>NSIncludesSubdomains</key>
<true/>
<!--Include to allow HTTP requests-->
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<!--Include to specify minimum TLS version-->
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
</dict>
</dict>
You can try add this function in file RCTHTTPRequestHandler.m
- (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler
{
completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]);
}
Simply add the following fields in your .plist file
Syntax looks like this:
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
You should add App Transport Security Settings
to info.plist
and add Allow Arbitrary Loads
to App Transport Security Settings
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
Update:
As of Xcode 7.1, you don't need to manually enter the NSAppTransportSecurity
Dictionary in the info.plist
.
It will now autocomplete for you, realize it's a dictionary, and then autocomplete the Allows Arbitrary
Loads as well.
info.plist screenshot