-
Re: NSData returning nil after upgrading the phone to iOS10
eskimo Nov 7, 2016 2:54 AM (in response to HIR)There are many potential reasons for this. You wrote:
But users upgraded to iOS 10, the app failed to connect to the web service.
Is it just some users? Or all users? Can you reproduce the problem yourself?
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardwarelet myEmail = "eskimo" + "1" + "@apple.com"
-
Re: NSData returning nil after upgrading the phone to iOS10
HIR Nov 14, 2016 11:45 AM (in response to eskimo)Hello,
it is for ALL iOS10 users. Yes, i can reproduce the issue.
-
Re: NSData returning nil after upgrading the phone to iOS10
HIR Nov 14, 2016 11:48 AM (in response to HIR)Also, today we found out that users with iOS version 10.1.1 are not even able to download the app from our server.
-
Re: NSData returning nil after upgrading the phone to iOS10
PBK Nov 14, 2016 1:18 PM (in response to HIR)If the https: site redirects you to an http: site then it will fail ATS. You may need to add an exception to your App Transport Security Settings.
Also, what do you mean by "not even able to download the app from our server"? iOS apps are downloaded through the App Store.
-
Re: NSData returning nil after upgrading the phone to iOS10
HIR Nov 17, 2016 7:46 PM (in response to PBK)Hello below is our plist. This is an enterprise app hosted on our windows server 2008 machine. do you suggest anything to add to the plist? or anything?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
<key>kind</key>
<string>software-package</string>
<key>url</key>
<string>https://abc.xyz.com/IphoneIPA/Myproduct.ipa</string>
</dict>
</array>
<key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>Mycompany.Myproduct</string>
<key>bundle-version</key>
<string>1.3</string>
<key>kind</key>
<string>software</string>
<key>title</key>
<string>Myproduct</string>
</dict>
</dict>
</array>
</dict>
</plist>
-
Re: NSData returning nil after upgrading the phone to iOS10
PBK Nov 21, 2016 11:54 AM (in response to HIR)Although the thread below is a deeper understanding of the problem/solution, a simple solution is to add the following lines to your info.plist:
1) add the following under "Info" in the target:
App Transport Security Settings - Dictionary
Exception Domains - Dictionary
yourWebsiteHere.com - Dictionary
NSExceptionAllowsInsecure H T TP Loads - Boolean - YES
NSIncludesSubdomains - Boolean - YES
2) or add directly to the plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" .......
<plist version="1.0">
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>yourwebsitewhateveritishere.com</key> // this is your http website without, I think, the first h t t p : / /
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSIncludesSubdomains</key>
<true/>
</dict>
</dict>
</dict>
</plist>
-
-
-
-
-
-
Re: NSData returning nil after upgrading the phone to iOS10
Claude31 Nov 7, 2016 8:54 AM (in response to HIR)I would suspect an authentication issue.
Have you looked at this :
http : / / stackoverflow.com/questions/18020494/nsdata-datawithcontentsofurl-not-returning-data-for-url-that-shows-in-browser
-
Re: NSData returning nil after upgrading the phone to iOS10
eskimo Nov 15, 2016 1:49 AM (in response to HIR)This is probably a TLS issue. For example, it’s possible your server is relying on RC4, which has been disabled on iOS 10 because it’s no longer secure (for this and other TLS-related news, see my App Transport Security pinned post).
The first thing I recommend is that you try to access the same resource via NSURLSession. This will give you access to the actual error that’s being returned by the networking stack. NSURLSession make it easy to run simple requests like yours. For example:
… assuming `url` is set up as per your code … NSURLRequest * request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60.0]; [[[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:^(NSData * data, NSURLResponse * response, NSError * error) { if (error != nil) { NSLog(@"error %@", error); } else { NSLog(@"success"); } }] resume];
If you can post details about the error, I should be able to advise you as to how to proceed.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardwarelet myEmail = "eskimo" + "1" + "@apple.com"
-
Re: NSData returning nil after upgrading the phone to iOS10
eskimo Nov 18, 2016 2:33 AM (in response to eskimo)This is an enterprise app hosted on our … server
Is your server’s certificate issued by a system-trusted CA? Or issued by your enterprise CA? My guess is that it’s the latter, in which case it sounds like you’re having trust evaluation problems with that CA. Are you sure the CA’s root certificate is installed on the device? Can you access other resources on that server from built-in tools, like Safari?
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardwarelet myEmail = "eskimo" + "1" + "@apple.com"
-
Re: NSData returning nil after upgrading the phone to iOS10
HIR Nov 20, 2016 6:47 AM (in response to eskimo)Hi,
the web service is accessible from safari and not from k2 iphone app.It used to work from k2 iphone app, like i said earlier.
the cert we use on the web server is Digicert.
-
Re: NSData returning nil after upgrading the phone to iOS10
eskimo Nov 21, 2016 2:56 AM (in response to HIR)the web service is accessible from safari and not from k2 iphone app.
What is “k2 iphone app” in this context?
Try accessing the resource using NSURLSession (as I suggested in my 15 Nov post). What error do you get?
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardwarelet myEmail = "eskimo" + "1" + "@apple.com"
-
-
-