简体   繁体   English

将自定义Cordova插件导入到Mobile First 8.1 React JS项目

[英]Import custom cordova plugin to mobile first 8.1 react js project

I used the command cordova plugin add [custom_plugin_path] into my mobile first 8.1 react js project. 我使用命令cordova插件将[custom_plugin_path]添加到我的移动设备第一个8.1 react js项目中。

But when I try to call the cordova.exec for the added plugin, it throws error that cordova is undefined. 但是,当我尝试为添加的插件调用cordova.exec时,会引发错误,指出cordova未定义。 May I know how to call the plugin in jsx? 我可以知道如何在jsx中调用插件吗?

Thanks. 谢谢。

Are you testing this on cordova platform browser, or by running the react app in your browser? 您是在cordova平台浏览器上进行测试还是在浏览器中运行react应用程序进行测试? Cordova will not be available in the browser. Cordova在浏览器中不可用。

Did you try testing it on a virtual/real device? 您是否尝试在虚拟/真实设备上对其进行测试?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM