cordova - Phonegap plugin on iOS not calling native code -
i trying implement first phonegap plugin (version 2.3) on ios - phone call of native function seems not work.
my plugin based on introduction: http://docs.phonegap.com/en/2.3.0/guide_plugin-development_ios_index.md.html#developing%20a%20plugin%20on%20ios
so added plugins-section of config.xml:
<plugin name="echo" value="echo" />
my calling javascript:
$(document).ready (function (){ $('#testbtn').submit(function () { alert("test"); var param = ["a", false]; cordova.exec( function(winparam) { alert("ok"); }, function(err) { alert("error"); }, "echo", "echo", param); homecoming false; }); }
(the alert in first row gets called pushing testbtn, rest should executed...)
in plugins-directory:
echo.h:
#import <cordova/cdv.h> @interface echo : cdvplugin - (void)echo:(cdvinvokedurlcommand*)command; @end
echo.m:
#import "echo.h" @implementation echo - (void)echo:(cdvinvokedurlcommand*)command { nslog(@"echo!"); } @end
the echo-function in echo.m never gets called ... can tell me why? don't error messages - nil happens...
i struggling in step you. called javascript function after device getting ready. problem has solved. now, working fine...
ios cordova plugins
No comments:
Post a Comment