Cordova barcode scanner plugin for iOS/Android, supports camera preview and continuos scanning.
The purpose of the plugin is to continuously scan for barcodes and show camera preview under main Cordova webView.
- iOS
- Android
Through the [Command-line Interface][CLI]:
# ~~ from master ~~
cordova plugin add https://github.com/asennikov/BarcodeScannerPlugin.git && cordova prepare
Through the [Command-line Interface][CLI]:
cordova plugin rm com.sandyclock.plugins.BarcodeScanner
The plugin creates the object window.plugins.barcodeScanner
with the following methods:
The plugin and its methods are not available before the deviceready event has been fired.
Start capture process. captureCallback
function will be called with decoded string data at each time when the plugin successfully decode barcode.
window.barcodeScanner.start(captureCallback, options);
Available options:
- cameraPosition ('front' / 'back').
function onStart() {
var options = {
cameraPosition: 'front'
};
window.plugins.barcodeScanner.start(onSucess, options);
}
function onSucess(data) {
window.alert(data);
}
Stop capture process.
window.barcodeScanner.stop();
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request