0
mfilechooser插件適用於android模擬器或設備上基於cordova的應用程序。沒有錯誤報告,但選擇器未啓動。科爾多瓦插件'mfilechooser'不適用於科爾多瓦的Android手機6.3.1
這是我的代碼的片段。
index.js
function choose(){
window.plugins.mfilechooser.open([], function (uri) {
alert(uri);
}, function (error) {
alert(error);
});
}
function onDeviceReady() {
}
function domLoaded(){
document.addEventListener("deviceready", onDeviceReady, false);
}
的index.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Security-Policy"
default-src 'self';
connect-src *;
style-src 'self' data: chrome-extension-resource: 'unsafe-inline';
img-src 'self' data: chrome-extension-resource:;
frame-src 'self' data: chrome-extension-resource:;
font-src 'self' data: chrome-extension-resource:;
media-src *;>
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<title>Hello World</title>
</head>
<body onload="domLoaded()">
<div>
<h1>Apache Cordova</h1>
</div>
<div>
<button onClick="choose()">choose file</button>
</div>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
</body>
</html>
科爾多瓦6.3.1 文件選擇:https://github.com/MaginSoft/MFileChooser
感謝您的幫助
添加此做你解決了該問題?我也面臨同樣的問題。任何建議。 – Ironic
沒有解決方案..不適用於SDK 23和cordova 6.3.1。我已經嘗試了大部分推薦的插件,但我仍然卡住..目前,我正在使用此插件[http://github.com/don/cordova-filechooser.git]/然而,回調沒有得到觸發,但我可以看到文件彈出和Android系統上的文件 – user2570135
我在奇怪的問題。我已經在config.xml中添加了插件cordova add plugin,但它並沒有解僱。我沒有得到文件選擇對話框或任何東西。螢火蟲也沒有錯誤。 – Ironic