使用Framework7时Cordova插件不起作用 [英] Cordova plugins not working when using Framework7

查看:191
本文介绍了使用Framework7时Cordova插件不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用iOS/Android上的Framework7制作Cordova应用程序.我正在尝试添加社交共享插件

I am making a Cordova app using Framework7 for iOS/Android. I'm trying to add the social sharing plugin and the barcode scanner plugin but the plugin functions can not be called. However when I made a Cordova app with plain HTML and JS (without Framework7) the plugins would work. Is there anything I have to modify on the Framework7 side to enable these Cordova plugins to work?

推荐答案

cordova.js文件不需要在项目根目录中.每次执行特定的平台构建时,都会在平台构建的项目根目录中自动创建它.

cordova.js file need not be there in your project root directory. Everytime you do a particular platform build, it gets automatically created in the platform build's project root directory.

例如,如果您使用"cordova build android"命令构建android平台,则会在"platforms \ android \ assets \ www"文件夹下生成cordova.js文件.使用任何cordova插件都非常需要此js文件,因为一旦cordova准备就绪且所有插件均已加载,该文件便负责触发"onDeviceReady"事件.您也可以查看一下生成的文件,以获取有关该文件的更多信息.希望对您有所帮助.

For instance, if you build android platform using 'cordova build android' command, the cordova.js file will be generated under 'platforms\android\assets\www' folder. This js file is very much required to use any of the cordova plugins as it is the one which is responsible for triggering 'onDeviceReady' event once the cordova is ready and all plugins are loaded. You can also have a look at the generated file once to get more info on the same. Hope it helps.

这篇关于使用Framework7时Cordova插件不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆