• info@happli.be

Migrating a Phonegap app to iOS 9

Migrating a Phonegap app to iOS 9

I installed the iOS 9 update as soon as Apple offered me to and … what a journey! The phone update process was smooth, as was installing the latest version of XCode (7).

But I’ve lost a lot of time making my phonegap app work again on iOS 9. Here’s a note on the things I’ve lost a lot of time on.

Not installing OS X El Capitan

Not installing OS X El Capitan on my Mac. It made the debugging experience awful. I couldn’t get anything written to Safari Web Inspector. Installing OS X El Capitan made it ok again.

App not initializing properly

Not having any clue why my Angular app wasn’t initializing properly. I first thought that I had the window.location bug which you can read about on the web: http://stackoverflow.com/questions/32719631/how-to-fix-window-location-issue-in-ios9-uiwebview. I read that Angular had to be fixed, that there was a patch out there and that the patch was included in AngularJS 1.4.6 => Had to migrate my angular components (cookies, route, google-maps) to that version. Still I had no result. ng-view not showing and nothing written on Web Inspector console. I’ve had to make two pages: one index.html (loading cordova) and a second one app.html (angular app). And by doing that I was able to get all the errors written to the console and could solve them one by one.

HTTP Request headers problems

I’ve had this problem as well with my services adding authentication headers to their http requests.

Apache hosting

I also had a web ui hosted on my Mac OS dev machine, under Apache, which I needed to use because it’s the “admin way” to the system’s data. It used to run under Yosemite, but didn’t any longer after El Capitan upgrade. I guess Apache got upgraded as well. I had to re-check all that config and was helped by this post. And indeed I think some of my previous customizations to Apache config files had been discarded by the upgrade process.