With this plugin, a cordova plugin can be implemented in this way:
AnnotatedCordovaPlugin
extends original CordovaPlugin
, so all methods are still accessible.
This plugin helps developers of cordova plugins to forget of the embarrassing and complicated way to develop a cordova plugin. Usually the developer had to implement a plugin like this (see Android Plugin Development Guide):
PluginAction annotation
It has 3 parameters, all of them optional:
- thread (ExecutionThread): enum, can be MAIN, UI, WORKER (defaults to MAIN)
- actionName (String): the name of the method as it will be called from Javascript (defaults to java annotated method name)
- isAutofinish (boolean): if
callbackContext.success()
has not been called andisAutofinish
is set totrue
, when method finishes,callbackContext.success()
will be called (defaults totrue
)
Then from javascript:
myPlugin { cordova;}; myPlugin;
Agreements
Why this rewritting of chemerisuk plugin?
- Implements proguard defaults
- Implements auto finish (automatically calls
callbackContext.success()
if it has not been called yet) - Documentation has been rewritten
- Methods have been heavily refactored and simplified to improve maintenance