Scan on iOS does not send result after flipping camera
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
+1 for this!
PS: is it possible to initialise it to start with the front camera?
+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!