Shazron's Cordova (aka PhoneGap) Blog

at Adobe Systems Inc.

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:

modernizr

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.

About these ads

Written by shazron

April 9, 2013 at 12:22 am

Posted in cordova, phonegap

15 Responses

Subscribe to comments with RSS.

  1. This is exciting news. Will this be added on to the cordova-cli node package as a supported platform in the near future?

    Jared Armstrong

    April 10, 2013 at 4:28 pm

    • Not sure, nothing is slated for 2.7.0 though. It would have to be after 2.7.0 at this point.

      shazron

      April 10, 2013 at 4:42 pm

  2. Hi shazron. I ported an iOS cordova app to OSX cordova and I having an issue with strophe connection. Does version 2.7.0 (OSX) support BOSH? Thanks.

    Peter Tran

    May 17, 2013 at 4:14 pm

    • I don’t see why it wouldn’t, if already works on iOS? (almost the same tech)

      shazron

      May 17, 2013 at 6:50 pm

  3. Hey, great news. I’ve been rolling my own Javascript OS X projects but would love to share iOS plugins.

    N D

    May 31, 2013 at 6:13 pm

  4. Is there some way to make the main window 1024×768?

    This would allow direct porting of iOS apps to OSX

    peardox

    June 4, 2013 at 7:38 am

    • Sorry – specifically designed for iPad apps is what I meant

      peardox

      June 4, 2013 at 7:40 am

    • Yup, just modify the main .xib file – add a constraint

      shazron

      June 11, 2013 at 11:20 pm

      • Already done that

        Not overly sure which numbers needed changing so changed all 5 sets

        640×480 looks a bit silly on a Mac :)

        Great work BTW

        We’ve just submitted an app to Apple using the new, improved, Mac OSX Cordova

        I’ll let you know how we do with acceptance (same app is already out under iOS)

        peardox

        June 12, 2013 at 6:03 am

  5. Thanks for your work as it’s exactly the kind of thing I want for some personal projects, I’ll hope you’ll have some time soon to work on the other plugins.

    Archiloque

    August 13, 2013 at 10:21 pm

  6. Will the CordovaFramework get updated to match the current Cordova version?
    And: I remember you had a OSX-Application (XCode) at one point. Do you still work on this?

    tiptronic

    January 7, 2014 at 2:46 pm

    • CordovaFramework updated to latest — Probably not. It’s been out there for a while and there has been no traction. Updating this requires cordova CLI support, but there are other fires to fight. We’ve been thinking of just using node-webkit so we get desktop support for OS X, Windows and Linux with one codebase (at the expense of file size).

      I’m not sure about your second question?

      shazron

      January 7, 2014 at 9:01 pm

      • IIRC you had a Cordova-based OSX Desktop App Template (XCode) somewhere, but I can’t find it anymore. If there was an application template (which also supports plugins) this could lead to a new class of desktop apps.

        tiptronic

        January 8, 2014 at 12:09 am

      • It’s linked in the article itself: https://github.com/apache/cordova-osx

        Instructions on how to create a new project is in the README.

        shazron

        January 8, 2014 at 12:12 am

      • Bummer! It seems that was too obvious 😉
        Thanks for the hint and the quick reply!

        tiptronic

        January 8, 2014 at 12:14 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,543 other followers

%d bloggers like this: