Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scan on iOS does not send result after flipping camera #282

Open
fretman92 opened this issue May 20, 2015 · 2 comments
Open

Scan on iOS does not send result after flipping camera #282

fretman92 opened this issue May 20, 2015 · 2 comments

Comments

@fretman92
Copy link

Hello,
On iOS, when you click on the flip camera button (to scan with the front camera), the process is cancelled, the JS code receives result.cancelled == 1 and no result is triggered when the actual scan is done.
I think this is due to line https://github.com/wildabeast/BarcodeScanner/blob/master/src/ios/CDVBarcodeScanner.mm#L393

Here is the code I'd write to make it work with both camera:

- (void)flipCamera
{
    self.isFlipped = YES;
    self.isFrontCamera = !self.isFrontCamera;
    [self performSelector:@selector(barcodeScanDone) withObject:nil afterDelay:0];
    [self performSelector:@selector(scanBarcode) withObject:nil afterDelay:0.1];
}

Cheers

@pmg103
Copy link

pmg103 commented May 20, 2015

+1 for this!

PS: is it possible to initialise it to start with the front camera?

@ppoisson
Copy link

+1 this was exactly what I was looking for. Now I can flip the camera and it scans as expected now. This should have been reported as a bug and fixed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants