BarcodeScanner Plugin

BarcodeScanner Plugin (the built-in plugin on Monaca Cloud IDE) can't be used with Android version 6 or higher and it may also not work with Cordova 6.5 projects for iOS platform. In this case, please use the external PhoneGap Plugin BarcodeScanner . In order to import this plugin, you need to subscribe to a valid plan. Please refer to Monaca Subscription Plans .

Enable Plugin in Monaca

  1. From the IDE menu, go to Config → Manage Cordova Plugins .
  2. Click Enable button of the BarcodeScanner plugin to add it into your project.

BarcodeScanner Demo

Here is a simple example demonstrating how to use the BarcodeScanner plugin with Monaca:

    <title>Barcode Scanner DEMO</title>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, user-scalable=no">
    <script src="components/loader.js"></script>
    <link rel="stylesheet" href="components/loader.css">

    <script type="text/javascript">

    function scanBarcode() {
        window.plugins.barcodeScanner.scan( function(result) {
                alert("We got a barcode\n" +
                          "Result: " + result.text + "\n" +
                          "Format: " + result.format + "\n" +
                          "Cancelled: " + result.cancelled);
            }, function(error) {
                alert("Scanning failed: " + error);


    <hr> BarcodeReader DEMO <hr><br>
    <input type="button" onClick ="scanBarcode()" value ="Scan" />

See Also: