javascript - How to use custom cordova plugin in ionic project? -


i have got simple custom cordova plugin here(https://github.com/don/cordova-plugin-hello), can output string, how can use plugin in ionic project after have installed it.

javascript interface of plugin this:

module.exports = { greet: function (name, successcallback, errorcallback) {     cordova.exec(successcallback, errorcallback, "hello", "greet", [name]); }}; 

and invoke javascript interface way:

window.plugins.hello.greet("world", success, failure); 

but doesn't work,and error following:

undefined not object (evaluating 'window.plugins.hello') 

i know old question, me plugin fired invoking way:

window.myplugin.pluginmethod(success, failure); 

interface of myplugin:

module.exports = {     pluginmethod: function(success, failure) {         cordova.exec(success, failure, "myclass", "method", []);     } } 

in case of problems plugins in cordova/ionic, it's log objects (like window) , see whether plugins there. remember log when cordova/ionic ready.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -