2

I have an existing app in the App Store that supports both iOS 7 and 8 (though I'll be dropping iOS 7 support shortly).

My latest version of the app has brought both IADs and AdMobs (where AdMobs act as a failover from IADS). With the upcoming launch of iOS 9, and the recent craze of Google requiring the removal of SSL (http://googleadsdeveloper.blogspot.ch/2015/08/handling-app-transport-security-in-ios-9.html HTTPS request in iOS 9 : NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)), from a beginner's point of view, I'd like to ask about some warnings I'm getting with my app running in Xcode 7 beta 5.

NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)

There's this link that I came across as well http://timekl.com/blog/2015/08/21/shipping-an-app-with-app-transport-security/?utm_campaign=iOS%2BDev%2BWeekly&utm_medium=email&utm_source=iOS_Dev_Weekly_Issue_213

So, what exactly do I need to do to remove this warning from the console when running my app on iOS 9?

I've come across one list that talks about disabling botched in Xcode, but firstly I don't understand what disabling that does, but also, is that required for this? What does ENABLE_BITCODE do in xcode 7?

Any thoughts on this would be really appreciated.

Community
  • 1
  • 1
amitsbajaj
  • 1,304
  • 1
  • 24
  • 59

3 Answers3

1

Read this App Transport Security Technote

Chances are, you'll have to set the NSAllowsArbitraryLoads to YES globally for now, because you aren't in control over what servers your ads come from.

Rahul Patel
  • 5,858
  • 6
  • 46
  • 72
dgatwood
  • 10,129
  • 1
  • 28
  • 49
  • @amitsbajaj Also, your current binary on the app store (linked against iOS SDK <= 8.x) should continue to function without problems, even on devices running iOS 9. You only need to apply these changes to your next version, built with iOS 9 SDK. – Nicolas Miari Sep 16 '15 at 04:56
  • Of course. For that matter, if you don't need to use any iOS-9–specific features or work around any iOS-9–specific bugs, you can temporarily avoid ATS entirely by switching the target SDK to iOS 8. That will buy you about one OS release cycle before the iOS 8 SDK goes away. :-) – dgatwood Sep 16 '15 at 05:01
  • You mean using Xcode 6, right? Xcode 7 will link against iOS 9 SDK (regardless of deployment target), and ATS rules apply I believe. – Nicolas Miari Sep 16 '15 at 05:03
  • No, I mean building against the previous SDK ("Base SDK" under "Architectures"). Usually, Apple ships both the current SDK and the previous one for a while after they release a new OS. If that's not the case for Xcode 7, then you may or may not be able to build against the previous SDK by dropping the old SDK into the right place inside the Xcode app bundle. I haven't had to try that in a while. – dgatwood Sep 16 '15 at 05:09
  • Oh, maybe I heard something about that once but never tried. – Nicolas Miari Sep 16 '15 at 05:12
  • 1
    @NicolasMiari Actually it seems like ATS do affect apps build with iOS 8.x SDK. I also thought that ATS wouldn't affect apps linked against iOS 8.x SDK. In this thread on the Apple Developer Forum (https://forums.developer.apple.com/message/40668#40668) an Apple Employe says that ATS shouldn't affect apps built with an earlier SDK than 9.0. Anyway, my app just stopped receiving ad from AdMob after I updated to iOS 9. Several apps, Google AdSense for example, also ceased to work properly after I upgraded to iOS 9. – Markus Sep 16 '15 at 19:18
  • 1
    The Apple employee is correct. However, if you're using shared libraries rather than static libraries, IIRC, the linked-on-or-after behavior of networking calls made by those libraries would apply to whatever version those libraries were linked against originally. So if AdMob linked their latest SDK against iOS 9 and you're linking against their SDK dynamically, it doesn't matter that your app itself was linked against the older SDK. Don't quote me on that, though. – dgatwood Sep 16 '15 at 20:14
0

Add below syntax to your app's info.plist,It's work for me.

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

enter image description here

0

because your are calling a server which has self-signed certificate. you have to by pass it.

starek
  • 1
  • 1