Shazron's Cordova (aka PhoneGap) Blog

at Adobe Systems Inc.

Archive for August 2012

11 upcoming changes for Cordova iOS 2.1.0

with 37 comments

1. Automatic Reference Counting (ARC) support

Finally the Cordova core has been upgraded to use ARC. Your project does NOT need to use ARC, but you can upgrade your project if you want using the Xcode menu option “Edit -> Refactor -> Convert to Objective-C ARC…”, then de-select libCordova.a. Note that if you do so, your plugins will need to be upgraded to use ARC as well. If doing so for plugins causes problems, you can disable ARC per file.

2. Removal of the (.pkg) Installer

This frankly was a stop gap in 2.0.0 until we removed it entirely. There is nothing to install now, you just download the source, and put it somewhere on your hard-drive in a permanent location. New projects when created using the command-line tool will refer to the CordovaLib that you ran the script from automatically. Note that if you move the source folder, you will need to run bin/update_cordova_subproject to update any existing projects.

3. Removal of the use of CORDOVALIB

In Cordova versions before 2.1.0, the location of the CordovaLib sub-project was through an Xcode variable called CORDOVALIB. So, when you updated your CordovaLib, your existing projects will pick up the new CordovaLib automatically by referencing this Xcode variable. This has proven to be problematic for using multiple versions of Cordova. Now, when you create a new project, the new project will have a hard-coded location for the CordovaLib sub-project, and to update this location you run the bin/update_cordova_subproject script which is located in a downloaded source version.

NOTE: This script updates the location of the CordovaLib sub-project as “relative to group” which means relative to where your project is located. This means, if you move your project folder, the CordovaLib sub-project reference will break (and you need to run the script again). This is mainly for source control purposes (where an absolute location is not friendly for teams). Watch this jira issue for updates.

4. Removal of the VERSION file dependency in code

The VERSION file is read from CordovaLib and set in JavaScript as the variable device.cordova, the code is not dependent on this file anymore (it may still be referred to in the Makefile), and reads the version from CDVAvailability.h at run-time.

5. Removal of CordovaLibApp and CordovaLibTest targets from the CordovaLib sub-project

When the CordovaLib sub-project is included in your project, all of its targets are included in the Schemes dropdown menu as well. This confused a lot of devs, and we removed the two extraneous targets into its own project. Those two targets are only used for testing. So now your Schemes dropdown menu will only include your project’s target, and the CordovaLib target.

6. Command-line scripts supports spaces in pathnames, symlinks

If you had spaces in your path when you ran any of the command-line scripts in 2.0.0, the script will fail. We fixed the problem in Cordova 2.1.0. If you are running 2.0.0, you can fix the problem by just copying in the updated scripts to your project’s cordova sub-folder.

7.  Whitelist format is less strict

Previously, the whitelist required an exact string match, with hostnames/IPs only. Now you can enter a full url with scheme, paths and query parameters – they will be parsed and only the hostname/IP will be considered.

8. New JavaScript->Native bridge

Our previous method used iframes, and starting with 2.1.0, we added an xhr bridge method by default. More details in this JIRA issue. This is to work around crash issues related to iOS UIWebView WebKit. You can change to the previous bridge implementation as well, the details are in the same JIRA issue linked previously. Note however that there is a bug in using the xhr bridge mode in iOS 4.2, so if you are on iOS 4.x, it will automatically default back to the iframe bridge.

9. iOS 6 compatibility changes

Fixed some issues related to the upcoming iOS 6 release. ‘Nuff said.

10. Diagnostics

There have been a lot of problems related to headers not being found, or the Archive build failing. There will be a diagnostics tool to help debug these issues. This tool is not in the rc1 yet, but will be in the final 2.1 release. Watch the related JIRA issue here.

11. New plugin signature (old signature is deprecated)

The new plugin signature is discussed in the Plugin Development Guide for iOS and also the Plugin Upgrade Guide. The old signature is still supported as per our deprecation policy.

Written by shazron

August 28, 2012 at 1:18 am

Posted in cordova, phonegap


Get every new post delivered to your Inbox.

Join 1,412 other followers

%d bloggers like this: