cordova ios:cordova.exec()undefined不是一个函数 [英] cordova ios : cordova.exec() undefined is not a function
本文介绍了cordova ios:cordova.exec()undefined不是一个函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用cordova(1.9)开发iOS应用程式。我有一些自定义iOS插件,使我的应用程序做一些东西。现在我面临一个问题,有时我调用:
cordova.exec(function(){} {},'MyPlugin','myMethod',['parameter']);
应用程式会抛出此异常:
TypeError:'undefined'不是一个函数(评估'cordova.exec(function(){},function(){},'WDMessageDispatcher','sendMessage',['showCategoriesList'] )')
插件是根据文档开发的,它可以工作,但不是每次。我真的不明白为什么。有人遇到了同样的错误吗?
解决方案
cordova.exec
可以在
之后调用
deviceReady()
已启动。
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?
解决方案
cordova.exec
can be invoked after
deviceReady()
has fired.
这篇关于cordova ios:cordova.exec()undefined不是一个函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文