barcode-scanner.js icon indicating copy to clipboard operation
barcode-scanner.js copied to clipboard

Disconnect, Offline storage and retry

Open unitedbummersconference opened this issue 10 years ago • 5 comments

Dear Pape thanks for this wonderful code.

I am trying your lib because of its developer friendlier , for me internet connectivity is not very reliable, so its causing some issues.

  • Could you please add/show an option to dual-save the scans offline or local storage in-case the browser disconnects. Or share a small sample on how I could achieve this in your lib.
  • Is there a debug/option to show the scanner is in ready/online or acquired mode. I have an indicator/textbox ontop, which I change to green when the scanner is connected.

thanks

unitedbummersconference avatar Dec 01 '15 22:12 unitedbummersconference

Asked by @unitedbummersconference here: https://github.com/pape-io/barcode-scanner.js/issues/3#issuecomment-161124622

Hi, for me on disconnects

 <form>
 <input data-barcode-scanner-target type='text'   class="pape-save-offline-barcode"></input>
  </form>
        $('form').on('submit', function(e){
        e.preventDefault();
        SaveToOffline();
        SeverBatchUpload();
    });

totally bombs out on me,would be supeer sweet, if this was an option

10xSebastian avatar Dec 02 '15 08:12 10xSebastian

As I want this library to focus on the detection, it's unlikely that I will store them locally in case of bad connection. Thats something your app should take care of, and obviously from your source code, you already solved that problem, don't you?

10xSebastian avatar Dec 02 '15 08:12 10xSebastian

The library cannot detect if the scanner is ready/online. In general web applications cannot detect if a scanner is connected via usb.

10xSebastian avatar Dec 02 '15 08:12 10xSebastian

For retrying simply use a retrying library like: https://github.com/johnkpaul/jquery-ajax-retry

10xSebastian avatar Dec 02 '15 08:12 10xSebastian

I would like to vote this up too :+1:

smartmeter avatar Dec 03 '15 05:12 smartmeter