BB10 APIs Now Available as Apache Cordova Plugins

Editor’s note: below is a blog post from Bryan Higgins from the WebWorks team. @bryanhiggins on Twitter

As a member of the WebWorks team at BlackBerry, I’m proud to announce that all of our BB10 APIs have been released as Apache Cordova plugins. Developers using Adobe PhoneGap or other Apache Cordova distributions will now have access to the full set of APIs that we ship as part of the WebWorks SDK.

Cordova Plugin Registry

The plugins are available through the recently launched Cordova Plugin Registry. This central database of plugins is accessible via the command line interface for developers running version 3.1 or higher.

To install a plugin, simply use the “plugin add” command with the plugin’s id (see the chart below for a full list):

cordova plugin add com.blackberry.bbm.platform

This will fetch the plugin from the registry and install it into the app. It may also modify the config.xml file under platforms/blackberry10 to include permissions required for the plugin to function correctly.

The Plugins

All of the plugins we released are listed in the chart below. The API column links to the relevant WebWorks docs. The permissions column lists any app permissions automatically added when the plugin is installed.

Moving From WebWorks to Apache Cordova

In the process of converting the WebWorks extensions to Apache Cordova plugins, two significant changes were introduced to make the APIs work well with the rest of the Apache Cordova ecosystem. If you’re a WebWorks developer moving to Apache Cordova, you’ll want to make note of these:

There is no need to add feature elements to config.xml. The WebWorks SDK relied on feature elements to include APIs at package time. Apache Cordova applications install plugins using command line tools before they are built.

Events are raised on document rather than blackberry.event. The core Apache plugins raise events on document. We have chosen to follow this convention. Use document.addEventListener rather than blackberry.event.addEventListener.

Follow Us On GitHub

The WebWorks team is committed to working in the open. All of our plugins are licensed under Apache 2 and full source code is available on our GitHub repository. Feedback and contributions are always welcome!

About Donny Halliwell

Donny is a Senior Product Marketing Manager at BlackBerry and Former Editor-in-Chief for the Inside BlackBerry blogs. There's no disputing, #TeamBlackBerry is awesome. I'm pumped to have the opportunity to talk with you and bring you the latest and greatest from Inside BlackBerry every day. In my spare time, I can be found helping entrepreneurs and startup companies grow their business. I spend the rest, obsessing over the auto industry, or enjoying music. Follow me on Twitter
or Google+

Inside BlackBerry Developers

The views expressed on any corporate or individual's personal website or any Twitter account are not necessarily those of BlackBerry. The user's Twitter account and/or personal website, any corporate website, or any comments contained on any of the foregoing have not been reviewed by BlackBerry and do not constitute an endorsement by BlackBerry.