Updating an existing Cordova App to iOS 8

Here are a few tips when you are ready to upgrade your existing Cordova App to iOS 8.  I migrated my Cordova 3.3.0 app this morning successfully following these instructions.

Step 1

Run npm install to upgrade Cordova to the latest with the following sequence of commands:

npm install -g cordova
cd my_project
cordova platform update android

Step 2

Update your project’s “Build Settings” for the target as follows:

    Build Active Architecture Only: “Yes”
    Valid Architectures: “arm64 armv7”

Step 3

If you’re updating an older version of Cordova, you will need to comment out or remove these lines from the “MainViewController.m” class:

- (BOOL)execute:(CDVInvokedUrlCommand*)command
{

    return [super execute:command];
}

Step 4 (optional)
If you need to have your WebView adjust the top 20px to account for the iOS 7/8 status bar, install the following plugin and update your config.xml accordingly. I have mine set as follows:

    <feature name="StatusBar">
        <param name="ios-package" onload="true" value="CDVStatusBar" />
    </feature>
    <preference name="StatusBarOverlaysWebView" value="false" />
    <preference name="StatusBarStyle" value="lightcontent" />
    <preference name="StatusBarBackgroundColor" value="#000000" />

Shazron’s blog goes into more details on a few other essential plugins here.

Advertisements
By Loutilities Posted in General

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s