What’s new in Cordova iOS 2.2.0

Submission to the Apple App Store requires the latest SDK, which is iOS 6. The iOS 6 SDK only comes with Xcode 4.5. Xcode 4.5 drops support for armv6, thus the minimum deployment target supported is iOS 4.3. This means that support for the iPhone 3G, and iPod Touch 2nd Generation is dropped.

2. Fixed iOS 6 and iPhone 5 issues

iOS 6 Contacts permissions support – this was the only API issue for iOS 6 that did not make it into 2.1.0

Capture API – for capturing audio, a new microphone image has been added for the iPhone 5 dimensions, and the Capture API view controllers support the new iOS 6 orientation delegate methods

Added the iOS 6 property SuppressesIncrementalRendering – set to YES (defaults to NO) to wait until all new view content has been received before it is rendered.

Added the iOS 6 property KeyboardDisplayRequiresUserAction – set to NO (defaults to YES) to open the keyboard when form elements get focus via JavaScript focus() call.

Changed the property BackupWebStorage (string, defaults to ‘cloud’) – valid values are ‘none’, ‘cloud’ and ‘local’. Set to ‘cloud’ to allow the web storage data to be backed up to iCloud, and set to ‘local’ to only allow local backups (iTunes sync). Set to ‘none’ to not allow any backups of web storage. The previous boolean property is deprecated and mapped to ‘cloud’ (true) and ‘none’ (false).

In 2.2.0 by default, the CordovaLib sub-project is copied into your project folder. Previously the CordovaLib sub-project was linked in to your project as a shared project. To still use a shared CordovaLib, add “–shared” as the first parameter to bin/create. This is useful for committers to just point to the CordovaLib from their git repo.

7. uncrustify hook for committers

Uncrustify is a utility that beautifies your code — essentially it enforces certain code formatting conventions. Right now it is only added to the iOS repo as a trial. See the issue: http://issues.cordova.io/625

In the root of your iOS repo, using the command line:

cd .git
rm -r hooks
ln -s ../hooks .

Otherwise, you should run the bin/uncrustify.sh command manually before checking in code on iOS.

8. onReset() override for plugins

Add a onReset() method to your plugin — this is called on top-level navigation or refresh, so that plugins can know to cancel any long-running requests and reinitialize themselves. This is for the situation where your WebView has been refreshed, and any operations and callbacks for plugins are invalid.

58 Responses

Reblogged this on Giacomo Balli and commented:
I upgraded my whole working suite yesterday (Snow Leopard to Mountain Lion, Xcode 4.2 to Xcode 4.5.1, PhoneGap 1.4.1 to PhoneGap 2.1).
Luckily everything went super smooth (had to do it without backup since I can’t find the wall adaptor for my external hard-drive since I moved from Italy!).
Later in the afternoon I read on twitter that the PhoneGap team released a new update.
The good news is that they’re really getting good at making updates easy to adopt (just did it).
This update is highly recommended since it addresses many little issues to fully use iOS6 (among other things).

just finnished my 7th ? upgrade this year and yet …. all the troubles again.

just from the top of my head:
– splash screen not working on iPhone 5
– gps config crashes app
– mess with arm7 xcodeproject file
– phonegap static library does not link if not “default” path in xcode selected (not documented anywhere)
… could continue for a while

after one year experience with phonegap definitively leaving phonegap and moving to grown up stuff

Hi Shazron, our app is currently at PG 1.6.1 and today we are evaluating a switch to a 2.* version. We would have mainly 2 reasons to do that: 1) increasing speed on Android/iOS; and 2) increasing GPS response on iPhone. Therefore, reading about PG 2.1 VS 2.2, we have trouble deciding which one to go for: on the one hand, there is that phrase: Java…” your code will now execute 15-25 times faster than our old bridges” and that one: C… ” 15% speed improvement in benchmarks” which seem to favor 2.2 absolutely, *** BUT *** on the other hand there is a troubling reply to this blog that gives us pause (and concern): “gps config crashes app”. Could you please elaborate on that (potential) problem. A.R.

I thought that autorelease was incompatible with ARC….when I use that file with autorelease, I get compilation errors.

I found out that the crash was caused by having BackupWebStorage=true instead of BackupWebStorage=cloud in my Cordova.plist file. This is something that you might also want to note in the release notes, since I think it changed with 2.2.

Hi Shazron,
I’m hoping you can help, we have show stopper issue on iOS using latest PhoneGap (2.2.0) ….it seems after an update (iOS or App) permanent files are no longer available…see here for more detail:

I believe I answered on the Google Group already🙂
Re-cap:
Are you storing the whole URL, and not a relative one? Just reconstruct from the relative one, prepending the permanent storage filesystem location.

Thanks for your reply – I know you are very busy. And FYI you have been super-helpful in the past!!

The issue still occurs even with the 768 x 1024 size splash screen. This happens on the Hello World demo app as well – it just happens more quickly on the demo app. This issue occurs on the demo app when using 768 x 1004 portrait splash screen (the one that comes by default in the build) and also when I replace it with the size specified in the docs – 768 x 1024.

I’m hoping to update all of my apps in the coming weeks and this is the only issue standing in my way. It is a small issue – but I fear anything that might raise an eyebrow during the app review process – and it is something that does not occur in my apps currently. Note that this is not happening on the iPhone or iPhone-simulator – just on the iPad and iPad-simulator.

Thanks again for your efforts. And just in case you guys don’t hear it enough – you guys rock!

Also You need to update the BackupWebStorage value from TRUE/FALSE to the new string value (cloud.. etc).. I got NSInvalidArgumentException crash because the old plist value is Boolean but the expected value is String.

Hi Shazron, I understand where you’re going with Cordova,plist and the local config.xml etc. But that does not clear the following category of problems: what if we want to change the generated plist behaviour for iOS on say BackupWebStorage (from cloud to local) for a PG Build app (an app that is targeted for several platforms and therefore CAN’T be built locally by Xcode, Eclipse, etc.)? In my example, as I understand it, that’s needed in order to have access to any app-generated files on iTunes. Where do we do that for a PG Build (yes, that website at https://build.phonegap.com)? Thanks for any idea (ANY idea), A.R.

hi guys i have a big problem facing in ipad 2 (ios version 6) . In my application am facing keyboard issue when keyboard enter am typing some thing my app screen event changed to portrait to landscape mode screen size button changed. but i will change the ipad portrait to landscape . the event will working.i will enter anything in keyboard the mode will be changed to por to land OR land to por mode how to fix plz help me guys. My application fully based on html5 .phone gap project