Open dlenski opened 2 years ago
Here are where the intent filters for the ZXing URI schemes are defined in the ZXing Barcode Scanner app: https://github.com/zxing/zxing/blob/master/android/AndroidManifest.xml#L61-L88
And most of the implementation is in…
ret
and SCAN_FORMATS
parameters: https://github.com/zxing/zxing/blob/99e9b34f5afc21fdaeead283d5ed0bc1314cbec1/android/src/com/google/zxing/client/android/CaptureActivity.java#L237-L249 ret
URI: https://github.com/zxing/zxing/blob/99e9b34f5afc21fdaeead283d5ed0bc1314cbec1/android/src/com/google/zxing/client/android/ScanFromWebPageManager.java
The no-longer-maintained ZXing Barcode Scanner app (com.google.zxing.client.android) supports a URI scheme that allows web apps to scan barcodes and retrieve the results…
As documented at https://github.com/zxing/zxing/wiki/Scanning-From-Web-Pages, these URIs look like the following:
http://zxing.appspot.com/scan?ret=http%3A%2F%2Ffoo.com%2Fproducts%2F%7BCODE%7D%2Fdescription&SCAN_FORMATS=UPC_A,EAN_13
zxing://scan?same_params
Basically, when one of these links is opened, an Android mobile browser will redirect to the app, scan a barcode, and then redirect back to the return UI specified, filling in query parameters like
{RAWCODE}
(the raw text of the barcoe) and{FORMAT}
(e.g.QR
).I have used this facility in a couple of web apps I've written myself. (I'm also a contributor to the core ZXing library, and the maintainer of a Python wrapper for it.)
tl;dr It would be really great if this much more modern barcode scanning app would handle the ZXing URI schemes, since this would allow web apps that rely on this mechanism to continue working.