fix(ios): fixed app crash on barcode detection without FirebaseMLVision (#2866)

Update the mode of the barcode detector only if it is a real detector.
Otherwise, the app will crash due to '-[BarcodeDetectorManagerMlkit setMode:queue:]:  unrecognized selector sent to instance'.

Co-authored-by: René Fischer <rene.fischer@zollsoft.de>
This commit is contained in:
René Fischer 2020-06-09 15:18:07 +02:00 committed by GitHub
parent dcbbbf453a
commit 263b34e520
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2105,7 +2105,9 @@ BOOL _sessionInterrupted = NO;
- (void)updateGoogleVisionBarcodeMode:(id)requestedMode
{
[self.barcodeDetector setMode:requestedMode queue:self.sessionQueue];
if ([self.barcodeDetector isRealDetector]) {
[self.barcodeDetector setMode:requestedMode queue:self.sessionQueue];
}
}
- (void)onBarcodesDetected:(NSDictionary *)event