I recently updated one of my iOS apps built with Ionic to run on iOS 9. Ionic Apps and iOS 9, especially apps built a while ago, don’t mesh out of the gate. Severla changes Apple made to iOS 9 will cause problems with your Ionic Apps. In this post, Ionic Apps and iOS 9, I want to touch on the three blocking issues I faced when updating my app.
- Failing to Archive because ‘Cordova/CDVViewController.h’ file not found.
- An SSL error has occurred and a secure connection to the server cannot be made.
- Invalid Bundle. iPad Multitasking support requires launch story board in bundle.
Ionic Apps and iOS 9 – ‘Cordova/CDVViewController.h’ file not found.
I found the answer to this problem on this Ionic Forum Post. With new introductions to xCode for tvOS a new path was required in my Build Settings Header Search Paths. I simple needed to add this string, "$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include". Making sure to not delete any of the other strings which are required for backward compatibility.
To do this make sure your app is selected in the left sidebar of xCode, select build settings (see image below), and navigate down to Header Search Paths and add the above string. That’s it, you’re done!
Ionic Apps and iOS 9 – An SSL error has occurred and a secure connection to the server cannot be made.
This error occurs because starting with iOS 9.0 and OS X v10.11 the new feature App Transport Security (ATS) is available and enabled by default. This requires all HTTP connections of your application to be secure and secure to Apple’s standards. To enable un-secure connections do the following steps.
Add the following to your <your-app-name>-Info.plist file. This file can be found with this file path: Platforms -> ios -> <your-app-name> -> *-Info.plist
And add the following code to your config.xml file.
<config-file platform="ios" target="*-Info.plist" parent="NSAppTransportSecurity">
That’s it! Now you’re up and running.
Ionic Apps and iOS 9 – Invalid Bundle. iPad Multitasking support requires launch story board in bundle.
This error will only occur to you if your app is available on iPad. There are two ways to fix this. One is to prepare your app so that it supports multitasking. The second is to have your app explicitly now allow multitasking. Right now I will provide a the latter solution.
To fix this error simple have your application require Full Screen to run. You can do that on the General Screen of xCode. See image below.
I hope that these solutions will help Ionic apps and iOS 9 work together peacefully and keep Ionic developers from pulling there hair out.