Coder Social home page Coder Social logo

Comments (8)

Evanion avatar Evanion commented on August 28, 2024 1

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.

wodka avatar wodka commented on August 28, 2024

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.

halfpt avatar halfpt commented on August 28, 2024

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.

wodka avatar wodka commented on August 28, 2024

@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.

halfpt avatar halfpt commented on August 28, 2024

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.

pdsullivan avatar pdsullivan commented on August 28, 2024

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.

pdsullivan avatar pdsullivan commented on August 28, 2024

hmm...

image

from phonegap-plugin-barcodescanner.

lock avatar lock commented on August 28, 2024

This thread has been automatically locked.

from phonegap-plugin-barcodescanner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.