WebsiteBeaver / react-native-document-scanner-plugin

A React Native document scanner plugin for Android and iOS
https://react-native-document-scanner.js.org/
MIT License
285 stars 55 forks source link

Document Scanner only working for first scan in Production/TestFlight release. #136

Open teefortayyab opened 1 week ago

teefortayyab commented 1 week ago

I have integrated the document scanner and it works fine in debugging release. but when I publish a TestFlight release, it scans for first document. after the successful scan, when I try to open scanner for next scan, it doesn't open camera scanner.

It looks like that Another view is already being presented and this could be why it's not displaying the scanner. It also not throwing any error as well. I have tried customizing the DocScanner.Swift and DocumentScanner.Swift files but it doesn't work fine in Production. Though, it's seamless in Debug mode.

Let me know how I can help further assist with it. It'd be really helpful for any quick response. @dmarcs @mateusz1913 @nicolascavallin @ghorbani-m @brennansaul

brewaiMing commented 6 days ago

I got the same issue here, so I connected my phone and opened the app in Xcode to investigate. While there were no error logs, I noticed a warning when trying to open the document scanner:

Unbalanced calls to begin/end appearance transitions for <RCTModalHostViewController:>

So this issue might caused by multiple modals being open simultaneously, including the document scanner. however, I add a line of code to close the previous modal still not working, so I add a setTimeout on document scanner code block so it will open after 100ms. and it fix the issue

Some related link that I been through:

"Unbalanced calls to begin/end appearance transitions" warning when push a view in a modal way in XCode 4 with Storyboard

Unbalanced calls to begin/end appearance transitions for <FirstViewController: 0x2a2c00>

Hope this is helpful!