search

Home  >  Q&A  >  body text

angular.js - 手机浏览器扫描二维码报错

手机浏览器扫描二维码时报错:cordova_not_avaliable,但是打包成app,扫描没有问题

import {BarcodeScanner } from "ionic-native";

 BarcodeScanner.scan().then((result) => {
            alert(result.text);
        }, (err) => {
            alert(err);
        });
世界只因有你世界只因有你2750 days ago745

reply all(3)I'll reply

  • 漂亮男人

    漂亮男人2017-05-15 17:14:45

    The problem description is not clear

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-05-15 17:14:45

    The QR code scanning function in this project is related to the cordova.js file and can only be run on a device or simulator

    reply
    0
  • 巴扎黑

    巴扎黑2017-05-15 17:14:45

    You use the cordova或者ionic native plug-in to scan the QR code, which of course can only be called in the packaged app!

    reply
    0
  • Cancelreply