Comments (8)
I discussed this on the Ionic IRC yesterday, and It seems like iOS registers the click twice, and tries to fire up 2 instances. I got a workaround from a helpful guy on IRC, but this fix seems to solve the issue @ native level, and I know we all like to avoid js bloat :)
from phonegap-plugin-barcodescanner.
By now I have a solution*:
one file needs to be modified:
AppDelegate.m
// replace line 88 "self.window.rootViewController = self.viewController;"
UINavigationController *aNavigationController = [[UINavigationController alloc]
initWithRootViewController:self.viewController];
self.window.rootViewController = aNavigationController;
(source: http://stackoverflow.com/questions/12350437/getting-current-uiviewcontroller-in-phonegap)
-> change will be that the right view is taken :)
you should also apply fix wildabeast/BarcodeScanner#282
update
It just reduced the freezes - the following error happens during a freeze:
Warning: Attempt to present <CDVbcsViewController: 0x13e6a9fb0> on <MainViewController: 0x13e5115f0> whose view is not in the window hierarchy!
from phonegap-plugin-barcodescanner.
Has there been any progress on this issue? I am encountering it too. I tried the changes to AppDelegate, but it adds an extra header menu into my app (I am using Ionic).
Any pointers would be greatly appreciated.
from phonegap-plugin-barcodescanner.
@halfpt can you try the change from the pull request? I finally found the reason for the behavior (at least for me) - I was calling the scan from a button and there it fired the event twice.
Somehow when it is executed twice the window reference is lost
from phonegap-plugin-barcodescanner.
Thanks a lot for getting back so quickly - I just applied the PR and it seems to have cleared the issue. Now I think back, my UI button seemed to click/flicker twice during the intermittent instances of the freeze. I'll report back if I encounter another freeze, but thanks again for the heads-up.
from phonegap-plugin-barcodescanner.
I had this happening as well, realized it was caused by the scanner being called more than once. Hope this helps someone. Preventing that from happening fixed the issue. 👍
from phonegap-plugin-barcodescanner.
hmm...
from phonegap-plugin-barcodescanner.
This thread has been automatically locked.
from phonegap-plugin-barcodescanner.
Related Issues (20)
- Plugin Crash HOT 5
- Plugin fails to declare ZXing activity HOT 1
- Android: camera not opening HOT 9
- Issue when scanning a GS1-128 barcode with \F (FNC1) terminator HOT 1
- Customize ui HOT 1
- "Close" button don't close the scanner when using overlayXib (iOS) HOT 1
- Scanning Failed : Scan is already in progress HOT 2
- global variable HOT 1
- Accessibility - add button label for the flash button HOT 2
- iOS: datamatrix scan result truncated when code contains null characters HOT 1
- after upgrading to ios 13.4.1 : index.html scan is already in progress HOT 2
- Does this plugin work in angular 8? HOT 1
- encode does not execute success or fail
- cannot installed this plugin over cordova / phonegap
- App crashes when try to open camera HOT 1
- Scanning of vertical barcodes not working on Android in portrait mode
- Unable to build with cordova-plugin-firebase-messaging HOT 1
- Android: Camera doesn't show, blinking elements when using Magni font size
- IOS - get noticed when the the scanning dialog is swiped out HOT 1
- the zxing version of barcodescanner-release-2.1.5.aar is?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phonegap-plugin-barcodescanner.