【问题标题】:Phonegap cordova.plugins.barcodeScanner.scan doesn't work on ipadPhonegap cordova.plugins.barcodeScanner.scan 在 ipad 上不起作用
【发布时间】:2018-12-07 18:53:52
【问题描述】:

正如标题所说,我在使用 cordova.plugins.barcodeScanner.scan 时遇到问题。

它适用于我测试过的所有其他设备(iPhone、Android 智能手机和 Android 平板电脑)。在 iPad 上,有一个问题。

正如您在下面的代码中看到的,我读取了一个二维码,然后将其发送到我的 API 服务器。

在服务器日志中,我可以看到从 iPad 发送的值是空的。

这是代码:

cordova.plugins.barcodeScanner.scan(
            function (result) {
                if (result.text == "") {
                    Notify("Aborted", "warning");
                    MyApp.app.navigate({ view: "Home" }, { root: true });
                    return;
                }
                vQR(result.text);

vQR 是我发送到服务器的内容。它在 iPad 上是空的,但在其他设备上正确设置。

这是我的配置:

<widget id="com.devexpress.apptemplate" version="1.0" versionCode="1">
  <name>ApplicationTemplate</name>
  <description>Template</description>
  <author email="info@info.com" href="http://www.info.com/">info</author>
  <preference name="permissions" value="none" />
  <preference name="prerendered-icon" value="true" />
  <preference name="phonegap-version" value="cli-7.0.1" />
  <preference name="android-windowSoftInputMode" value="adjustPan" />
  <preference name="SplashScreenDelay" value="3000" />
  <preference name="AutoHideSplashScreen" value="false" />
  <preference name="SplashShowOnlyFirstTime" value="false" />
  <preference name="FadeSplashScreen" value="false" />
  <preference name="ShowSplashScreenSpinner" value="false" />
  <preference name="DisallowOverscroll" value="true" />
  <preference name="StatusBarOverlaysWebView" value="false" />
  <preference name="StatusBarStyle" value="default" />

  <feature name="StatusBar">
    <param name="ios-package" value="CDVStatusBar" onload="true" />
  </feature>
  <preference name="StatusBarBackgroundColor" value="#000000" />
  <preference name="android-minSdkVersion" value="15" />
  <preference name="android-targetSdkVersion" value="26" />
  <platform name="android">
    <resource-file src="google-services.json" target="google-services.json" />
  </platform>
  <platform name="ios">
    <resource-file src="GoogleService-Info.plist" />
  </platform>
  <plugin name="cordova-plugin-geolocation" spec="2.4.1" />
  <plugin name="cordova-plugin-inappbrowser" />
  <plugin name="cordova-plugin-splashscreen" onload="true" />
  <plugin name="cordova-plugin-whitelist" />
  <plugin name="cordova-plugin-ios-longpress-fix" />
  <!--<plugin name="cordova-plugin-statusbar" onload="true" />-->
  <plugin name="phonegap-plugin-push" spec="2.0.0" />
  <plugin spec="https://github.com/Telerik-Verified-Plugins/BarcodeScanner.git" source="git">
    <param name="CAMERA_USAGE_DESCRIPTION" value="To scan barcodes." />
  </plugin>
  <plugin name="cordova-plugin-camera" spec="^2.4.1" source="npm">
    <variable name="CAMERA_USAGE_DESCRIPTION" value="This app requires access to take picture and send them, if needed." />
    <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="This app requires access to the photo library to send them, if needed." />
  </plugin>
  <plugin name="cordova-android-support-gradle-release">
    <variable name="ANDROID_SUPPORT_VERSION" value="26.0.0"/>
  </plugin>
  <access origin="*" />
  <!--<engines>
    <engine name="android" spec="^6.3.0" />
  </engines>-->
</widget>

iPad 保护套有什么特殊设置吗?

【问题讨论】:

    标签: ios cordova ipad qr-code barcode-scanner


    【解决方案1】:

    非常非常奇怪...重新安装应用解决了问题!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-11-06
      • 2011-03-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多