4

i am new to ios development .

can anybody pls tell me . is it possible to use Zxing lib for scanning bar/qr-code on iPhone for a webapp(HTML5/javascript) ?

i mean my webapp needs to use Zxing , Is it possible ?

john R
  • 41
  • 1
  • 1
  • 2

2 Answers2

3

Barcode scanning requires use of the camera on your phone, this device is not available from a webapp and therefore you cannot scan barcodes from the webapp, regardless of the library you would like to use.

Also, I dont think you can use C, C++, Objective C libraries from your javascript/html5 these libs would have to be on the phone where your code cannot get to it, and your browser most certainly cant run it.

One alternative would be PhoneGap, I am not too familiar with it, but it is an iOS (and or Android) shell around a webapp that runs as a native app. You could probably get camera support in there and maybe use the Zxing lib. You would have to look into that, but then you dont 'really' have a webapp anymore either.

EDIT: For phoneGap and Zxing see also: how to scan barcode using phonegap

Community
  • 1
  • 1
ophychius
  • 2,623
  • 2
  • 27
  • 49
2

These days you can get it working with the HTML5 Camera API and this little beauty; https://github.com/LazarSoft

enjoy.

asbjornenge
  • 1,209
  • 13
  • 16