UNPKG

phonegap-plugin-barcodescanner-ps

Version:

You can use the BarcodeScanner plugin to scan different types of barcodes (using the device's camera) and get the metadata encoded in them for processing within your application.

24 lines (21 loc) 551 B
function scan(success, error) { var code = window.prompt("Enter barcode value (empty value will fire the error handler):"); if(code) { var result = { text:code, format:"Fake", cancelled:false }; success(result); } else { error("No barcode"); } } function encode(type, data, success, errorCallback) { success(); } module.exports = { scan: scan, encode: encode }; require("cordova/exec/proxy").add("BarcodeScanner",module.exports);