Hi,
I apologize in advance if this has been answered, but I have looked and looked and found nothing. I can get the Barcode scanner to invoke using the function below. However, I get a blank result, blank format, and true for cancelled after the scan takes place. Does anyone have an idea what I'm missing?
Function:
function scanBarcode() {
var scanner = cordova.require("cordova/plugin/BarcodeScanner");
scanner.scan( function (result) {
alert("We got a barcode\n" +
"Result: " + result.text + "\n" +
"Format: " + result.format + "\n" +
"Cancelled: " + result.cancelled);
$("#tn_text").val(result.text);
}, function (error) {
alert("Scanning failed: " + error);
} );
}
Alert
We got a barcode
Result:
Format:
Cancelled: true
some config.xml entries
<!-- ios: controls whether data types (such as phone no. and dates) are automatically turned into links by the system -->
<!--<activity android:orientation="keyboardHidden" />-->
Thanks in advance.
Jeremy
I apologize in advance if this has been answered, but I have looked and looked and found nothing. I can get the Barcode scanner to invoke using the function below. However, I get a blank result, blank format, and true for cancelled after the scan takes place. Does anyone have an idea what I'm missing?
Function:
function scanBarcode() {
var scanner = cordova.require("cordova/plugin/BarcodeScanner");
scanner.scan( function (result) {
alert("We got a barcode\n" +
"Result: " + result.text + "\n" +
"Format: " + result.format + "\n" +
"Cancelled: " + result.cancelled);
$("#tn_text").val(result.text);
}, function (error) {
alert("Scanning failed: " + error);
} );
}
Alert
We got a barcode
Result:
Format:
Cancelled: true
some config.xml entries
<!-- ios: controls whether data types (such as phone no. and dates) are automatically turned into links by the system -->
<!--<activity android:orientation="keyboardHidden" />-->
Thanks in advance.
Jeremy

