Имеется PhoneGap-приложение.
Adnroid версия перестала открывать камеру для использования QR-код сканера, при этом на iOS всё прекрасно работает. Куда смотреть?
JS-код QR-код сканера:
function ticketScan() {
cordova.plugins.barcodeScanner.scan(
function (result) {
if (result.format=='QR_CODE') {
if (result.text) {
$$.get(getTokenUrl(result.text), function (data, status, xhr) {
data = JSON.parse(data);
if (data.mess) myApp.alert(data.mess);
if (data.notice) setNotice(data.notice);
if (data.html) {
$$('#scanner-result').html(data.html + '<br /><p><a href="#" onclick="$$(' + "'#scanner-result').html('')" + '" class="button">Очистить</a></p>');
}
});
} else {
myApp.alert('Нет результата сканирования!');
}
} else {
myApp.alert('QR-код не найден!');
}
},
function (error) {
myApp.alert("Ошибка сканирования: " + error);
}
);
}
Файл config.xml:
<?xml version='1.0' encoding='utf-8'?>
<widget id="ru.myapp.mobapps" version="1.1.6" versionCode="73" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
<name>MyApp</name>
<description>
Mobile application site
</description>
<content src="index.html" />
<preference name="android-build-tool" value="gradle" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="16" />
<preference name = "android-targetSdkVersion" value = "26" />
<plugin name="cordova-plugin-battery-status" source="npm" spec="~1.2.4" />
<plugin name="cordova-plugin-camera" source="npm" spec="~4.0.3">
<param name="CAMERA_USAGE_DESCRIPTION" value="We are using the Camera for something..." />
<param name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="We are using the Photo Library for something..." />
</plugin>
<plugin name="cordova-plugin-media-capture" source="npm" spec="~1.4.3" />
<plugin name="cordova-plugin-console" source="npm" spec="~1.0.2" />
<plugin name="cordova-plugin-contacts" source="npm" spec="~2.0.1" />
<plugin name="cordova-plugin-device" source="npm" spec="~1.1.6" />
<plugin name="cordova-plugin-device-motion" source="npm" spec="~1.2.0" />
<plugin name="cordova-plugin-device-orientation" source="npm" spec="~1.0.2" />
<plugin name="cordova-plugin-dialogs" source="npm" spec="~1.2.0" />
<plugin name="cordova-plugin-file" source="npm" spec="~4.3.3" />
<plugin name="cordova-plugin-file-transfer" source="npm" spec="~1.5.0" />
<plugin name="cordova-plugin-geolocation" source="npm" spec="~2.4.3" />
<plugin name="cordova-plugin-globalization" source="npm" spec="~1.0.7" />
<plugin name="cordova-plugin-inappbrowser" source="npm" spec="~1.7.1" />
<plugin name="cordova-plugin-media" source="npm" spec="~2.2.0" />
<plugin name="cordova-plugin-network-information" source="npm" spec="~1.3.3" />
<plugin name="cordova-plugin-splashscreen" source="npm" spec="~3.2.1" />
<plugin name="cordova-plugin-statusbar" source="npm" spec="~2.1.2" />
<plugin name="cordova-plugin-vibration" source="npm" spec="~2.1.5" />
<plugin name="cordova-plugin-whitelist" source="npm" spec="~1.2.1" />
<plugin name="phonegap-plugin-barcodescanner">
<param name="CAMERA_USAGE_DESCRIPTION" value="To scan barcodes." />
</plugin>
....
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="mailto:*" />
<platform name="android">
<allow-intent href="market:*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<feature name="Camera">
<param name="android-package" value="org.apache.cordova.CameraLauncher" />
</feature>
</widget>