ttatarinov / lineapro-phonegap-plugin

LineaPro Phonegap Plugin
MIT License
19 stars 44 forks source link

Switching between phonegap app and other app causes incomplete barcodes to scan #7

Open jameswagoner opened 9 years ago

jameswagoner commented 9 years ago

I start the app fresh and scan a few barcodes, working as expected. I then switch to the browser to lookup a url. Once I switch back the app and continue to scan (I have to click the scan button to reconnect), I only get first part of the barcode. I need to either restart the scanner or completely close the app and reopen it.

Is there any additions that should be added to ensure the scanner reconnects?

warrenbell commented 9 years ago

Reinitialize in a Cordova "on resume" event, assuming you are talking about opening up Safari directly and not in your scanning app with something like an inAppBrowser plugin.

ahornsby commented 9 years ago

I had that problem too, barcodes seemed to intermittently truncate 2 digits from the end. Have added the onResume event as per suggestion, so hopefully that will fix it. Thanks.

ahornsby commented 9 years ago

Still intermittently get the truncation problem when initially opening the app. The "on resume" or closing and re-opening it does fix it, but weird how it happens in the first place. It's consistently the last 2 digits of any barcode that are missing.

jameswagoner commented 9 years ago

I can confirm the truncating of the last two characters. I am working on the resume event as well. Glad to hear is does work.

Only problems I encounter with startup is occasionally I need to press the scan button to get the app connected to the scanner or even restart the scanner.

On Thu, Oct 16, 2014 at 3:50 AM, Andrew Hornsby notifications@github.com wrote:

Still intermittently get the truncation problem when initially opening the app. The "on resume" or closing and re-opening it does fix it, but weird how it happens in the first place. It's consistently the last 2 digits of any barcode that are missing.

— Reply to this email directly or view it on GitHub https://github.com/ttatarinov/lineapro-phonegap-plugin/issues/7#issuecomment-59344410 .

James Wagoner

ahornsby commented 9 years ago

Just to clarify, the resume event will fix the truncation only by resuming the app rather than having to close it completely. It hasn't stopped the truncation from randomly happening in the first place! Would like to be able to pin down what is causing it. Am wondering whether I need to reinitialize on each new page, or just periodically.