Shazron's Cordova (aka PhoneGap) Blog

at Adobe Systems Inc.

What’s new in Cordova iOS 2.4.0

with 13 comments

cordova_bot

1. Removal of JSONKit, replaced with NSJSONSerialization

Since we dropped support for iOS 4.x, this is now possible. See the Plugin Upgrade Guide.

2. Support for ArrayBuffer arguments over the exec bridge

Only for top level arguments (nothing nested). It converts the ArrayBuffer to a NSData object, and vice-versa. See CB-2189 and CB-2215.

3. The start page can be specified in config.xml

Through the content tag.

4. FileTransfer “trustAllHosts” parameter

This is now supported. Set to true to trust hosts with self-signed certificates, for example.

5. InAppBrowser enhancements, and fix

Enhancements are specified here. Basically these are the same settings as in the Project Settings, also presentation and transition styles are added. The fix for InAppBrowser is specified here. Basically, on iOS 6, when you load PDFs in the InAppBrowser, it resets the User-Agent for all UIWebViews which we rely on for our exec bridge — our fix helps work around that, with caveats.

6. Custom url-scheme handler ‘handleOpenURL’ not called on startup

It was not being called on first app launch, but has now been fixed. Resume from backgrounding has always worked.

7. FileTransfer failing for file:/// urls

Fixed. An alternative is to use xhr.

8. require.js lazy loading of cordova.js

This should  work now.

9. Various deprecated methods removed

See the wiki.

10. Default splash-screen sizes 10x smaller

Shouldn’t affect you much.

11. There was an ARC issue in Contacts

See this issue.

12. Support Reading Slices of Text Files.

From Simon McDonald’s blog post regarding Cordova Android 2.4.0:

The File object now has a slice method. Suppose the file we’re reading contains the text:

“All that is gold does not glitter, not all those who wander are lost.” 

Then…

  • f.slice(4, 8) would result in “that”
  • f.slice(9) would be “is gold does not glitter, not all those who wander are lost.”
  • f.slice(-5, -1) would be “lost”

[NOTE] I want to also draw attention to cordova-cli being released with 2.4.0. More on Raymond Camden’s blog. In a nutshell, this is an abstraction for the command-line utilities that are included for the different platforms all in one easier to use interface, plus the ability to add and remove plugins.

About these ads

Written by shazron

February 8, 2013 at 3:44 pm

Posted in cordova, phonegap

13 Responses

Subscribe to comments with RSS.

  1. [...] “trustAllHosts” parameter, in addition to other features and fixes. See “What’s new in Cordova iOS 2.4.0” for a complete list of [...]

  2. why when create a project with cordova 2.4 create a project with cordova 2.3???

    Alberto

    February 13, 2013 at 11:47 am

    • Not sure what you mean here. Make sure you create from the right folder that you downloaded.

      shazron

      February 13, 2013 at 7:26 pm

      • Sorry for my english, but i download cordova from https://www.apache.org/dist/cordova/, extract cordova-ios and run creation process. The result is cordova-2.3.js in www directory and the version of the program in Xcode is 2.3. The same thing is from phonegap download. I think than i wasn’t wrong. But maybe yes.

        Alberto

        February 14, 2013 at 8:40 am

      • I did exactly as you described. It’s 2.4.0 every-time – nothing wrong with the downloads. There’s something wrong in how you are creating the project, possibly.

        shazron

        February 15, 2013 at 12:47 am

      • I don’t know how but now work also for me. Thanks

        Alberto

        February 15, 2013 at 10:46 am

  3. I upgraded from Cordova 2.2 to 2.4 and have an issue where the ChildBrowser stops working. I’ve been able to determine that it breaks when I go to a secondary page which has links. It will either work in the first page or the second page but not both. And once broken it won’t work in either page. I tried commenting out the usage of ChildBrowser and substituting the InAppBrowser but having the same effect. The console posts: Failed to load webpage with error: The URL can’t be shown. I upgraded to try to fix an issue with the Calendar Plugin but now wishing I could back out of it.

    Daniel

    February 18, 2013 at 5:42 pm

  4. Dear Shazron, thx for Cordova/Phonegap for iOS. I updated to v2.4 and it is working well on iOS 5.0/5.1 on simulator and devices, but using iOS 6.0/6.1 on simulator and devices it seems the ‘onSuccess’ of a fileTransfer never gets called for me. I get the “-[CDVFileTransferDelegate connectionDidFinishLoading:] [Line 473] File Transfer Download success”, but nothing happens, the source code I’m using in my ‘onSuccess’ isn’t called on those versions of iOS >= 6.

    RonMen

    February 19, 2013 at 9:33 am

  5. [...] For iOS specific details, you can also check out Shazron Abdullah’s blog post about What’s New in Cordova iOS 2.4.0. [...]

    PhoneGap 2.4.0 Released

    February 19, 2013 at 3:45 pm

  6. [...] 2.3.0 for Windows Phone and Windows Store applications. PhoneGap updates for iOS could be found here. Cordova 2.4.0 updates for Android are available in this article. Most of changes and new features [...]

  7. I cannot figure out how to use Cordova 2.4.0 with require JS. Are there any examples? I am including it in as a path, and everything works fine till I try to optimize my code…. then I get an error in the terminal while I am going through this process

    Joe Tint

    March 14, 2013 at 3:00 am


Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 1,489 other followers

%d bloggers like this: