Shazron's Cordova (aka PhoneGap) Blog

at Adobe Systems Inc.

Archive for the ‘phonegap’ Category

What’s new in Cordova iOS 2.9.0

leave a comment »


Just a regular bug fix update, nothing much really. We’re pushing this release quickly so we can get going on 3.0.0 for PhoneGap Day US, details in this blog post. Lots of cool changes in the pipeline!

Highlights of this release:

  • new InAppBrowser option (start hidden)
  • removed
  • a bunch of bug fixes
  • a fix so a Cordova project can deploy to device on OS X 10.9 Mavericks

* [CB-3469] Add a version macro for 2.8.0.
* [CB-3469] Adding missing license found by RAT
* [CB-2200] Remove (deprecated)
* [CB-3031] Fix for emulate script when project name has a space
* [CB-3420] add hidden option to InAppBrowser
* [CB-2840] Nil checks to avoid crash when network disconnected
* [CB-3514] Remove partially-downloaded files when FileTransfer fails
* [CB-2406] Add ArrayBuffer support to FileWriter.write
* [CB-3757] camera.getPicture from photolib fails on iOS
* [CB-3524] cordova/emulate and cordova/run silently fails when ios-sim is not installed
* [CB-3526] typo in cordova/lib/install-emulator – does not check for ios-sim
* [CB-3490] Update CordovaLib iOS Deployment Target in Project Setting to 5.0
* [CB-3528] Update Plugin Upgrade Guide for iOS
* [CB-3530] PhoneGap app crashes on iOS with error “CDVWebViewDelegate: Navigation started when state=1″
* [CB-3768] Build to phone failing on Xcode 5 DP1 (OS X Mavericks)
* [CB-3833] Deprecation plugin tag upgrade step has malformed xml
* [CB-3743] Remove compatibility headers folder
* [CB-3619] ./cordova/run script does not always call ./cordova/build first
* [CB-3463] bin/create should copy cordova.js into the project’s CordovaLib
* [CB-3530] PhoneGap app crashes on iOS with error “CDVWebViewDelegate: Navigation started when state=1″ (for navigation to an anchor on the same page)
* [CB-3507] Wrong Linker Flag for project template
* [CB-3458] remove all_load dependency. Use force load instead
* Removing “build” from gitignore as one of our cli scripts is named build :)
* Added/renamed CDVExifTests to test project.

Written by shazron

June 27, 2013 at 9:47 pm

Posted in cordova, phonegap

What’s new in Cordova iOS 2.8.0

with 2 comments


  • deprecation of the <plugin> tag in config.xml (replaced by <feature>)
  • cordova-XXX.js is just cordova.js now (on all platforms)
  • new InAppBrowser options
  • EXIF metadata writing for photos
  • New command line scripts for your project

* [CB-2840] Nil checks to avoid crash when network disconnected
* [CB-3416] adding empty element during deprecation window.
* [CB-3006] Customize InAppBrowser location bar
* [CB-3405] InAppBrowser option to hide bottom bar with Done/History buttons
* [CB-3394] Cordova iOS crashes when multiple access elements in config.xml
* [CB-3166] Add deprecation notice for use of <plugin> in config.xml in iOS
* [CB-2905] Exif geolocation meta data tag writing
* [CB-3307] Rename cordova-ios.js -> cordova.js
* [CB-1108] Convert <plugin> -> <feature> with <param>
* [CB-3321] Fix bogus “failed whitelist” log messages
* [CB-3311] add default textbox for notification prompt
* [CB-2846] SplashScreen crashes app when image not available
* [CB-2789] Remove CaptureOptions.mode support.
* [CB-3295] Send InAppBrowser loadstart events when redirects occur
* [CB-2896] added ImageIO and OpenAL system frameworks to support new exif functionality in CDVCamera
* [CB-2896] writing data to object through CGImageDestinationRef, enables multipart exif tag writing
* [CB-2958] simple fix, moved write to photealbum code and sourced from modified data. Photo data returned by cordova will match photo on cameraroll
* [CB-3339] add version to command line scripts
* [CB-3377] Remove cordova/release script
* [CB-2974] Add a ./cordova/lib/list-devices project-level helper script to iOS
* [CB-2951] Add a ./cordova/lib/list-emulator-images project-level helper script to iOS
* [CB-2974] Add a ./cordova/lib/list-devices project-level helper script to iOS
* [CB-2966] Add a ./cordova/lib/list-started-emulators as project-level helper script to iOS
* [CB-2990] Add a ./cordova/lib/install-device project-level helper script to iOS
* [CB-2982] Add a ./cordova/lib/install-emulator project-level helper script to iOS
* [CB-2998] Add a ./cordova/lib/start-emulator project-level helper script to iOS
* [CB-2916] Add a ./cordova/clean project-level script for iOS
* [CB-2053] Update UIImagePickerController label to reflect video media type in CDVCamera
* [CB-3530] PhoneGap app crashes on iOS with error “CDVWebViewDelegate: Navigation started when state=1″

Written by shazron

June 11, 2013 at 11:38 pm

Posted in cordova, phonegap

What’s new in Cordova iOS 2.7.0

with 10 comments

cordova_botMainly bug fixes, the only highlights are new features for InAppBrowser – executeScript() and insertCSS(). Download 2.7.0.

1. Script Updates

  • [CB–2849] Fix bin/create when CordovaLib parent dir has a space
  • [CB–2788] add ./bin/check_reqs script to iOS
  • [CB–3048] Add –arc flag to create script, support arc in template.

2. FileTransfer Updates

  • [CB–2537] Implement streaming downloads for FileTransfer
  • [CB–2190] Allow FileTransfer uploads/downloads to continue in background
  • [CB–1518] Request content length in parallel with download for gzipped content
  • [CB–51] Added httpMethod for file transfer options (defaults to POST)
  • [CB–2824] Remove DebugConsole plugin
  • [CB–3066] Fire onNativeReady from JS, as bridge is available immediately

3. Whitelist Updates

  • [CB–3032] Add whitelist support for custom schemes.
  • [CB–3067] iOS 5.0 file urls are not passing whitelist due to recent changes

4. Miscellaneous

  • [CB–2725] Fix www deploy issues with symlinks
  • [CB–2732] Only set camera device when allowed.
  • [CB–2911] Updated resolveLocalFileSystemURI.
  • [CB–2587] Added plugin timing for plugins that are loaded on startup (plugin ‘onload’ attribute)
  • [CB–2848] ShowSplashScreenSpinner not used
  • [CB–2960] Changing the volume of a sound already playing
  • [CB–3021] Can no longer import CDVPlugin.h from plugin Objective-C++ code
  • [CB–2698] Fix load detection when pages have redirects.

5. Camera EXIF Updates

  • [CB–2902] re-added long/short tags to template dict, fixed subExifIFD offset
  • [CB–2896] Multipart exif tags are not written correctly
  • [CB–2790] Removed old splice code, replaced with JpegHeaderWriter api calls
  • [CB–3039] iOS Exif date length mismtach
  • [CB–3052] iOS Exif SubIFD offsets incorrect

6. InAppBrowser Updates

Written by shazron

May 3, 2013 at 11:08 pm

Posted in cordova, phonegap

Cordova/PhoneGap and the new Apple App Store Requirements

with 4 comments

Beginning May 1st 2013, apps submitted to the Apple App Store…

1. must be built for iOS devices with Retina display and iPhone apps must also support the 4-inch display on iPhone 5

2. will no longer accept new apps or app updates that access UDIDs

Cordova/PhoneGap fulfills requirement (1) since version 2.5.0 and fulfills requirement (2) since version 1.7.0.

But what if my Cordova/PhoneGap app, which I am unwilling to upgrade, needs to be updated and submitted to the App Store?

You will have to manually update and patch your code. It’s not going to be an easy task, and I should warn you that upgrading will be easier. The main changes are to handle the iPhone 5 sized splashscreen, and the code to handle that is only in Cordova/PhoneGap 2.5.0. You can include the iPhone 5 sized asset and this will trigger the app to be the right size, but because of our splashscreen support it needs to match iOS showing the splashscreen after that splashscreen disappears. See our SplashScreen API for more details.

To be doubly sure – select your project icon in the Project Navigator in Xcode, then select the Summary tab. Select your project target then review the App Icons and Launch Images sections – you’ll see if you are missing anything or whether the assets are not the right sizes (denoted by the yellow triangle icon with an exclamation point in it).

Written by shazron

May 1, 2013 at 7:48 pm

Posted in cordova, phonegap, xcode

Create new PhoneGap/Cordova projects using cordova-create-gui

leave a comment »

cordova_bot_osxThis is for OS X only, and does not check for project requirements yet (which may be coming with the bin/check_reqs scripts in 2.7.0). Essentially this proof of concept project is a GUI wrapper for the bin/create scripts you know and love. You could use this against the the iOS, OS X, Android and BlackBerry source (although I have only tested it for iOS and OS X projects). Think of this as Handbrake for ffmpeg.

The project routes the stderr and stdout from the script call back to your callback function, and also reports the resultcode for you to further process.

Ideally this would be a GUI for cordova-cli instead, that may come in the future. This app was also created using itself, and Cordova OS X.

Download the complete runnable project.

View and fork the source on Github.

The GUI itself won’t win any awards yet, but is workable (click to enlarge):


Written by shazron

April 16, 2013 at 12:53 am

Posted in cordova, phonegap

Cordova OS X – Resurrection

with 15 comments

cordova_bot_osxNo, I didn’t use an Alien Queen embryo for this one. Dormant for so long, this has been brought up to date vis-à-vis the iOS Plugin architecture, and supports OS X 10.7 (Lion) and 10.8 (Mountain Lion). This means that if you know how to create an iOS Plugin, you can create an OS X one as well. The JavaScript to native bridge is synchronous, while the native to JavaScript bridge is asynchronous, just like iOS.

Not all core plugins are there. The only core plugins available at the moment are the Connection API, and the Device API, and the only event supported is the deviceready event.

To create a new project, follow the same command line usage as iOS. Download the source code.

The WebView used is from the system WebKit, which varies depending on your OS X version. Since it uses the system WebKit, the Web API support follows from it, and running Modernizr on a Cordova OS X project on OS X 10.8.3 there is broad support for most of the APIs out there except for indexeddb, some advanced input types, flexbox and WebGL. WebGL can be enabled in code however. See the Modernizr report below:


Future updates will add support for the rest of the Cordova APIs, whether as a JavaScript shim or as complete plugins. Interfaces to create/update the native menus, and native context (right-click) menus are also on the plate as well. Full-screen support is there already. JavaScript bindings for native objects for plugins is being considered as well.

Written by shazron

April 9, 2013 at 12:22 am

Posted in cordova, phonegap

What’s new in Cordova iOS 2.6.0

with 8 comments

cordova_bot1. Config.xml <preference> changes – added KeyboardShrinksView and HideKeyboardFormAccessoryBar. UIWebViewBounce renamed to DisallowOverscroll. EnableLocation deprecated.

HideKeyboardFormAccessoryBar will hide the form accessory bar (the Next, Prev and Done buttons) when the keyboard is shown for  handling input in a textbox.

KeyboardShrinksView will shrink the WebView when the keyboard comes up. The WebView shrinks instead of the viewport shrinking and the page scrollable. This applies to apps that position their elements relative to the bottom of the WebView. This is the default behaviour on Android, and makes a lot of sense when building apps as opposed to webpages.

The UIWebViewBounce preference was changed to DisallowOverscroll to be consistent with Android (thus the default value is the opposite).

The EnableLocation preference is deprecated – set  the “onload” attribute of the CDVLocation plugin element instead.

2. InAppBrowser API – “loaderror” event added

You can listen for the loaderror event to be notified of any errors in loading any URLs in the InAppBrowser.

3. Notification API changes

notification.prompt feature added – allows a customizable prompt versus the JavaScript one. Also, You can also use commas for button labels for notification.confirm.

4. FileTransfer API changes

FileTransfer download allows setting of headers now. Both FileTransfer upload and download will now support Basic Auth automatically when the username and password is encoded in the URL.

5. Camera API changes

You can now select the front or back camera on Camera.getPicture().  EXIF metadata is also included in the images returned from the Camera API, see this issue. Fixed crash when camera not available.

6. Various splash-screen issues fixed

See this issue.

7. Various iframe issues fixed

See this and this.

8. Various FileReader issues fixed

See this and this.

9. Multi-part plugin result is now supported

See this and this. Basically now callbacks can receive more than one argument.

10. Plugins can be dynamically registered (outside of config.xml)

See this issue.

Other fixes are in the RELEASE NOTES.

Written by shazron

April 8, 2013 at 11:53 pm

Posted in cordova, phonegap


Get every new post delivered to your Inbox.

Join 1,681 other followers

%d bloggers like this: