Shazron's Cordova (aka PhoneGap) Blog

at Adobe Systems Inc.

What’s new in Cordova iOS 2.3.0

with 40 comments


1. iOS 5.x and above support only

We are dropping iOS 4.x support and only supporting iOS 5.0 and greater, going forward.

2. Cordova.plist is changed to config.xml

The configuration Cordova.plist file has been changed to config.xml — it comes in a new format that is the same as the Android config.xml. If you are upgrading, you will need to convert your existing Cordova.plist by running the bin/cordova_plist_to_config_xml script. The 2.3.0 project itself will warn you (in the console log) if you are still using the old Cordova.plist and tell you to upgrade.

The new project settings are documented here.

An example config.xml:

        <preference name="MySetting" value="true" />
            <plugin name="MyPlugin" value="MyPluginClass" />
        <access origin="*" />

3. InAppBrowser – includes events

More details here. In a nutshell, this has the same functionality as the ChildBrowser, and has events support as well. It supports this simplified spec. Also, the InAppBrowser does not use the app whitelist. Example usage:

var ref ='', '_blank');
ref.addEventListener('loadstart', function(event) { alert(event.type + ' - ' + event.url); } );
ref.addEventListener('loadstop', function(event) { alert(event.type + ' - ' + event.url); } );
ref.addEventListener('exit', function(event) { alert(event.type); } );

// also, you can do ref.removeEventListener('loadstart', myfunc) .. etc

4. LocalNotification  plugin event, AppDelegate override

Your project’s AppDelegate.m can add a new AppDelegate override so your plugins can receive LocalNotification events. Uncomment these lines  to enable your plugin to receive the notifications in their overrides.

5. Renaming of Cordova cli commands

The new list of commands are here. Basically debug has been renamed to build, and new release,  and run commands have been added. This is common across all the platforms.

6. Objective-C plugins are not white-listed anymore

With the InAppBrowser release, we restructured the whitelist to only apply to the main Cordova WebView. As a consequence, the whitelist does not apply to all connections for the app, thus connections from your plugins are not whitelisted. To whitelist your connections with the app whitelist, you will need to set the “User-Agent” header of the connection to the same user-agent as the main Cordova WebView.

You can get this by accessing the userAgent property off the main view-controller. The main view-controller (CDVViewController) also has a URLisAllowed method for you to check whether a URL will pass the whitelist. See this guide.

7. Device API changes

Minor changes as specified here. For iOS, device.platform used to return “iPhone”, “iPad” or “iPod Touch” — now it returns (correctly) “iOS”. For iOS, (now deprecated for all platforms) used to return the name of the user’s device (e.g ‘Shazron’s iPhone 5’) — now it returns what device.platform used to return: “iPhone”, “iPad” or “iPod Touch”.  For all platforms, there is a new property called device.model — this returns the specific device model, e.g “iPad2,5” (for other platforms, this returns what used to return).

8. CommandDelegate overrides

The command delegate could not be overriden properly, now fixed. Please look at this issue on how to override the delegate functions, for inspection.

Check out the Release Notes for other minor changes.

Written by shazron

December 10, 2012 at 9:37 pm

40 Responses

Subscribe to comments with RSS.

  1. Thank you Shazron


    December 11, 2012 at 7:42 am

  2. Hi Shazron – You helped me on the previous IAB blog post. I’m still having issues with opening PDFs on this Cordova app. Its a downloaded and localized website for a client that I have wrapped in Cordova to make an app they can browse on their iPads when not connected to the internet. There are lots of products, each with a few PDFs. When I start the iOS simulator and go to any page in the app and click a PDF, it opens in IAB. Any PDF on the same page will open and close perfectly. When I navigate to any other page in the app and click any PDF it does nothing. I get no error and no console log. When alerting the URL to the PDF, the URL is correct whether the IAB works or not, so I know pathing is correct. Here is my invocation code:

    This is using the latest Cordova:
    // commit 861ff3d507fd5c64ed789d8abe360690e588252e
    // File generated at :: Mon Dec 10 2012 15:38:02 GMT-0800 (PST)


    December 12, 2012 at 5:48 am

    • Try alerting ‘’ on that page where it doesn’t work, and report back.


      December 12, 2012 at 5:52 am

      • Would that be:

        iabRef =, “_blank”, “location=no”);
        iabRef.addEventListener(‘loadstart’, onLoadStart);
        iabRef.addEventListener(‘loadstart’, onLoadStop);
        iabRef.addEventListener(‘exit’, onExit);

        I tried that and its [object Object] – obviously not what you are looking for. It alerts that for working and non-working pages.


        December 12, 2012 at 6:04 am

      • No – actually try alert( itself


        December 12, 2012 at 6:19 am

  3. I tried al ert(, “_blank”, “location=no”)); in both the launchURL function and higher up in the jquery code instead of calling launchURL (shown and on both the working pages and non working pages its still [object Object] as shown

    Thank you so much for your continued support.


    December 12, 2012 at 6:30 am

  4. OK thanks.

    Working page:

    Non-working page:


    December 12, 2012 at 7:01 am

    • Aha, that non-working page does not have Cordova loaded. I assume the path is correct for the cordova js?


      December 13, 2012 at 7:13 pm

      • OK, that is correct – a copy/paste error. Still not right though.

        Working page: – alert shows up, then click OK, then PDF loads in IAB.

        Now on the non-working page, the links work when I click them, but the PDFs don’t open in IAB. – alert shows up, then click OK, then nothing happens.

        Same message, but one is within a scrolling alert. I think that is just with the wrapping html page name in the header of the alert.


        December 13, 2012 at 7:45 pm

      • More clarification – if I have alert( in place on the non-working page, you get the alert, then click Close, then nothing happens. If I comment alert( out on the non-working page, the PDF opens, but not in IAB.


        December 13, 2012 at 7:46 pm

      • Hi Chad, this comments section is unproductive — I suggest you file an issue at and assign it to me. Include a www folder with html and also sample media to illustrate the problem and for me to repro, and for others to search on. I’ll take a look there.


        December 13, 2012 at 8:26 pm

      • I want to also make clear that I can go to either page first, and the PDFs open in IAB. Then visit the other page second, and they don’t work.


        December 13, 2012 at 8:22 pm

  5. […] it looks like the installation of 2.2.0 is the same as 2.1.0. However, expect exciting changes when Cordova 2.3.0 is […]

  6. Hi Shazron, I am using PhoneGap 2.2.0 and PDF’s are a PITA to work with. Will the upcoming release enable dev’s to open PDF’s (stored in a local folder) in ChildBrowser windows with less hassle?
    …. I was taking a look at the comments and it seems some work is being done to address the solution.


    December 17, 2012 at 7:50 am

    • Yup. If you have a file called ‘test.pdf’ in your www folder, all you need to do is:'test.pdf', '_blank');


      December 21, 2012 at 12:09 am

      • From what I know, it is the same even in earlier version of Phonegap; Webkit opened PDFs just fine.

        Can you elaborate exactly what changed that pdf opening is easy in Cordova 2.3?


        January 11, 2013 at 7:13 pm

      • the InAppBrowser.


        January 11, 2013 at 7:22 pm

  7. still support for ios4.3?


    December 20, 2012 at 3:15 am

    • Oops I knew I forgot something. I will amend the post.


      December 21, 2012 at 12:04 am

  8. What do you mean by support is dropped for iOS <5.0? Does that mean Cordova will fail to do anything on iOS <5.0?

    Steven Vance

    January 8, 2013 at 12:52 am

    • Cordova will only compile under iOS 5 and greater – we are only looking forward to use iOS 5 API and up.


      January 8, 2013 at 12:55 am

  9. […] Informationen zu den iOS-relevanten Neuerungen finden sich im iOS-Readme, die für Android entsprechend im […]

  10. Looks great! Thanks!


    January 11, 2013 at 11:53 pm

  11. Broken for iOS?

    I’m currently using 2.2, I downloaded 2.3 but the sample project whist it builds does not run in the simulator, just says ‘tests complete’ and exits instantly. Upgraded my 2.2 project to 2.3 and it runs (i.e. doesn’t instantly exit) but the app can’t fully load, no errors in Xcode, Safari web inspector console says ‘file:///!gap_execFailed to load resource: The requested URL was not found on this server.’ several times. Perhaps the plugins have a newer format? Looked at the plugins on git but I can’t see any 2.3 specific changes.

    Shazron I need you 🙂

    [reposted from as I realised you were unlikely to see it]

    System: OSX 10.8.2 and Xcode 4.5.2


    January 13, 2013 at 7:42 pm

    • A new project doesn’t run? That’s indeed strange. It’s not broken, most likely something with your setup. If you want to package your sample project (this is a new project right?) and put it up somewhere, I can take a look.


      January 13, 2013 at 7:46 pm

      • 2 sample projects: (one working, one not)

        Upon creating another sample project it did build. Only obvious difference is the xcode project starts with a number, I guess that’s breaking it.

        With regards to migrating a 2.3 to 2.3 (I created another sample project and copied my www in), any ideas about the safari console error ‘file:///!gap_execFailed to load resource:’?


        January 13, 2013 at 8:14 pm

      • Looks like this bug: but it was fixed a long time ago.


        January 14, 2013 at 10:06 pm

  12. So is it now impossible to retrieve the old value on iOS? (e.g. ‘Shazron’s iPhone 5′)?

  13. Upgraded to 2.3.0 last night, very smooth.

    My only glitch, and pardon my ignorance here, is that I find the guides ( to set the whitelisting correct for InAppBrowser extremely confusing.

    While I’m sure there was good reason to have plugins ignore the app whitelist, I’m not really sure how to use the InAppBrowser so that it follows my whitelist settings. Am I supposed to directly edit the InAppBrowser plugin itself?


    January 30, 2013 at 3:26 pm

    • All the core plugins as defined in do follow the whitelist, except for InAppBrowser, which is by design. I invite you to file an enhancement issue at (with a use case) so the devs can discuss the need for this.


      January 30, 2013 at 6:20 pm

      • Thanks for the quick reply. I will look into adding an enhancement request.


        January 30, 2013 at 6:31 pm

  14. This was helpful. I came across this while updating an old StackOverflow Answer

    We met in BlackBerry Jam in Amsterdam, thought I’d say hi.


    February 25, 2013 at 12:29 am

    • Thanks Phillip! Was great meeting you at BB Jam EU, drop by the Adobe SF office if you are in town 🙂


      February 25, 2013 at 5:37 am

  15. The config.xml’s is overwriting Xcode’s “build” value … any way to fix this?


    July 1, 2014 at 1:11 pm

  16. Sorry my previous comment was truncated:

    The config.xml’s widget “version” attribute is overwriting Xcode’s “build” value … any way to fix this?


    July 2, 2014 at 10:43 am

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: