我试图在我的Ionic 4应用程序中使用此插件:https://github.com/IOCare/cordova-plugin-smartconfig
我使用 ionic cordova plugin add https://github.com/IOCare/cordova-plugin-smartconfig.git
安装了插件,它似乎被添加到项目中 . Cordova插件列表显示:cordova-plugin-smartconfig 1.0.4 "Cordova Smart Config"
I have tried:
declare var espSmartConfig: any;
并使用 espSmartConfig.startConfig()
和
declare var cordova: any;
并使用 cordova.plugins.espSmartConfig.startConfig()
,
和
declare var window: any;
并使用 window.espSmartConfig.startConfig()
..但一切都不明 . 我已经尝试在我的Android手机上使用Ionic DevApp,并在我的PC上使用chrome .
我确定我错过了一些明显的东西,但我无法弄清楚是什么 . 我发现的所有文档都指的是本机插件 .
2 回答
cordova插件添加https://github.com/IOCare/cordova-plugin-smartconfig.git
声明var espSmartconfig;
espSmartconfig.startConfig("ssid","00:00:00:00","password","NO",1,function(res){},function(error){console.log(error);});
espSmartconfig.stopConfig(function(res){console.log(res);},function(error){console.log(error);});
正如你们中的一些人建议我尝试构建应用程序并在手机上运行它 . 工作就像一个魅力:
所以这里的问题只是我用来测试应用程序的工具 .
谢谢大家的意见!