PDF417 / pdf417-phonegap

PDF417 and QR code scanning plugins for PhoneGap/Cordova framework
47 stars 21 forks source link

I Can't scan serveral times #25

Closed cquezpro closed 8 years ago

cquezpro commented 8 years ago

Yes. Scan works, but it works only one time, If I tried to scan again, then scan is not working. here is console log. hope this is helpful.

Patient Tracker[287:60680] Warning: Attempt to present on whose view is not in the window hierarchy! Patient Tracker[287:60680] Warning: Attempt to present on whose view is not in the window hierarchy! Patient Tracker[287:60680] Warning: Attempt to present on whose view is not in the window hierarchy! Patient Tracker[287:60680] Error in Success callbackId: Pdf417Scanner326430938 : ReferenceError: Can't find variable: hex2a Patient Tracker[287:60680] Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates.

dgust6 commented 8 years ago

Hello,

Have you tried using our PhoneGap demo app? You can create it by running the script initDemoApp.sh. When the script is run, xcode project file should be created at "Pdf417Demo/platforms/ios". Could you run the app and check if the same error appears?

cquezpro commented 8 years ago

It seems it working but I have barcode scan and camera features, pls see my log. If I remove pdf417 plugin, everything is okay, but when I add this plugin, I can scan only one time, and try to scan DL or Barcode Scan or Take photo is not working.

dgust6 commented 8 years ago

Could you have an issue similar to this one: https://github.com/PDF417/pdf417-phonegap/issues/21 ?

cquezpro commented 8 years ago

Hi Thank you for link. It seems similar, but I don't have any inappbrowser.

I have three buttons on the app. DL scan, Barcode Scan, Take a photo. DL Scan works fine one time, I got result, and click buttons again to scan or take photo.

but nothing is happened. This is issue I got. :) Thanks

dgust6 commented 8 years ago

The problem is that our scanningViewController is trying to be presented on top of a ViewController which is not in the window hierarchy. This could be a problem with your code handling the first scanning results. You could try the solution posted in the linked issue as problem is the same and it is not related to inappbrowser.

Alternatively, you could try replacing these 2 lines in our plugin: https://github.com/PDF417/pdf417-phonegap/blob/master/Pdf417/src/ios/sources/CDVpdf417.m#L358 and https://github.com/PDF417/pdf417-phonegap/blob/master/Pdf417/src/ios/sources/CDVpdf417.m#L361 This could fix the issue but we can't be certain as this issue isn't related to our SDK.

cquezpro commented 8 years ago

okay, but what means replace? what is trying code for replacement for above two lines? Thanks

dgust6 commented 8 years ago

Sorry,

Switch the position of them :) (keep them both in code)

cquezpro commented 8 years ago

No lucky.

Scan first works fine. and second time not working.

But close app (Tap Home icon on iphone) and run app again, then DL Scanner appeared.

Patient Tracker[499:190754] Error in Success callbackId: Pdf417Scanner1142733526 : ReferenceError: Can't find variable: hex2a Patient Tracker[499:190754] Phone default language unsupported, setting English Patient Tracker[499:190754] THREAD WARNING: ['Pdf417Scanner'] took '75.639893' ms. Plugin should use a background thread. Patient Tracker[499:190754] Phone default language unsupported, setting English Patient Tracker[499:190754] THREAD WARNING: ['Pdf417Scanner'] took '206.644043' ms. Plugin should use a background thread. Patient Tracker[499:190754] Warning: Attempt to present <CameraViewController: 0x1301954f0> on <MainViewController: 0x12ee3be20> whose view is not in the window hierarchy! Patient Tracker[499:190754] Warning: Attempt to present <CDVCameraPicker: 0x12f884200> on <MainViewController: 0x12ee3be20> whose view is not in the window hierarchy!

cquezpro commented 8 years ago

And old version of this plugin worked fine in my project. only got some crash for several DLs, so I updated new plugin.

cquezpro commented 8 years ago

Hi. Any good news for this? Thank s

Cerovec commented 8 years ago

Hi, did you manage to resolve this issue?