cordova ios : cordova.exec() undefined is

2020-07-13 07:10发布

问题:

I'm developing an iOS app using cordova(1.9). I've some custom iOS plugins to make my app do some stuff. Now I'm facing a problem, sometime when I call :

cordova.exec(function(){},function(){},'MyPlugin','myMethod',['parameter']);

The app throws this exception :

TypeError: 'undefined' is not a function (evaluating 'cordova.exec(function(){},function(){},'WDMessageDispatcher','sendMessage',['showCategoriesList'])')

The Plugin was developed following the documentation and it works but not everytime. I don't really understand why. Someone else experienced the same error?

回答1:

cordova.exec

can be invoked after

deviceReady()

has fired.