We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
最近手头上正在开发的app需要用到扫码功能,于是上用上了这一个cordova的插件目前来说适配ios以及安卓的效果还不错。推荐下大家尝试使用。
cordova.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); }, { "preferFrontCamera" : true, // iOS and Android "showFlipCameraButton" : true, // iOS and Android "prompt" : "Place a barcode inside the scan area", // supported on Android only "formats" : "QR_CODE,PDF_417", // default: all but PDF_417 and RSS_EXPANDED "orientation" : "landscape" // Android only (portrait|landscape), default unset so it rotates with the device } );
4. 注意事项:scan方法需要在deviceReady之后调用
document.addEventlisterner('deviceready',onDeviceReady,false); function onDeviceReady(){ //here bind event to click to use camera to scan barcode }
html中需要通过script引入cordova.js(执行cordova build android之后在asserts目录下就能找到对应的文件)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
最近手头上正在开发的app需要用到扫码功能,于是上用上了这一个cordova的插件目前来说适配ios以及安卓的效果还不错。推荐下大家尝试使用。
这就不去详细描述里,参考[cordova官网](http://cordova.apache.org/
插件地址
html中需要通过script引入cordova.js(执行cordova build android之后在asserts目录下就能找到对应的文件)
The text was updated successfully, but these errors were encountered: