Barcode Scanner
$ ionic plugin add phonegap-plugin-barcodescanner
Repo: https://github.com/phonegap/phonegap-plugin-barcodescanner
The Barcode Scanner Plugin opens a camera view and automatically scans a barcode, returning the data back to you.
Requires Cordova plugin: phonegap-plugin-barcodescanner
. For more info, please see the BarcodeScanner plugin docs.
Supported platforms
- Android
- iOS
- Windows Phone 8
- Windows 10
- Windows 8
- BlackBerry 10
- Browser
Usage
import {BarcodeScanner} from 'ionic-native';
BarcodeScanner.scan().then((barcodeData) => {
// Success! Barcode data is here
}, (err) => {
// An error occurred
});
Static Methods
scan()
Open the barcode scanner.
Returns: Returns a Promise that resolves with scanner data, or rejects with an error.