What keeps us busy?
Our stories from the Trenches.

Posts in category mobile

Cordova: Open External Links in the Native Browser

Written by Sepp Wijnands on Friday 15 November 2013 in mobile

If you want to open an external website or a user's Facebook page, you more than likely would like to open it in their mobile's platform main browser.

But, by default in Cordova/Phonegap, when a (external) link is clicked, it will just load it into your application view instead. Thereby potentially messing up the state of your application, and leaving you with no control over when or if the user decides to return to your application.

iOS users of your application will have it even worse. Since iOS has no built-in concept of a 'back' button, this pretty much guarantees that a user cannot return to your application, without terminating it first.

Not a pretty sight. Luckily, there's an easy fix.

Cordova: Whitelist rejection error

Written by Sepp Wijnands on Tuesday 12 November 2013 in mobile

In older versions of Phonegap and Cordova the default setting was to disallow applications to access any external network host, unless explicitly specified in the config file.

If you are unfamiliar with this functionality, the first time you try to access an external resource, you will be greeted by the following error message in some form or another:

2013-11-12 18:06:04.847 HelloCordova[14941:70b] ERROR whitelist rejection: url=''

Upgrading to a newer version of Cordova/Phonegap will not automatically fix this problem for you, because the policy is controlled by the www/config.xml file, which will be generated only once, and then be left alone by the command line utilities.

Cordova: Fix for iOS 7 status bar

Written by Sepp Wijnands on Sunday 27 October 2013 in mobile

Since the introduction of iOS 7.0 and the accompanying iOS7 SDK, the status bar behavior in iOS has changed. The status bar can now change color and/or be part of the application.

While sounding nice on the surface, it more or less spelled temporary doom for cordova and phonegap applications who would like to keep the old behavior.

Luckily with the new 3.1.0 release of cordova you can!

In the latest release there is a new status bar plugin, in which, among other things you can revert the status bar back to its pre iOS7 state.

Since 2006 our products and services have helped hundreds of people optimize their daily business: