09-24-2013 01:25 PM
The template is the recommended way.
That said, we are migrating to Cordova, so a new Template for Cordova Plugins was released last week. In the next MR of the Native SDK, that old WebWorksExtension will be updated with this new Cordova template.
New template is here: https://github.com/blackberry/WebWorks-Community-A
09-24-2013 01:31 PM
In order to use them inside a Cordova app, they do need to be modified. Not much really, but a little bit is different.
For return values you create a PluginResult object and call methods on that object, so callbacks are also a little different: instead of using hard-coded event names, each function call gets a unique callback ID, which in the template I passed down to native so that the right callback is fired.
That's about it though.