Added setter of onReadCode.
This commit is contained in:
parent
43e8a40cf0
commit
35c6fca5c3
|
@ -297,18 +297,23 @@ RCT_ENUM_CONVERTER(CKCameraZoomMode, (@{
|
|||
else {
|
||||
self.setupResult = CKSetupResultSessionConfigurationFailed;
|
||||
}
|
||||
if (self.onReadCode) {//TODO check if qrcode mode is on
|
||||
self.metadataOutput = [[AVCaptureMetadataOutput alloc] init];
|
||||
[self.session addOutput:self.metadataOutput];
|
||||
[self.metadataOutput setMetadataObjectsDelegate:self queue:dispatch_get_main_queue()];
|
||||
[self.metadataOutput setMetadataObjectTypes:[self.metadataOutput availableMetadataObjectTypes]];
|
||||
}
|
||||
|
||||
|
||||
[self.session commitConfiguration];
|
||||
} );
|
||||
}
|
||||
|
||||
-(void)setOnReadCode:(RCTDirectEventBlock)onReadCode
|
||||
{
|
||||
_onReadCode = onReadCode;
|
||||
if (self.onReadCode) {//TODO check if qrcode mode is on
|
||||
self.metadataOutput = [[AVCaptureMetadataOutput alloc] init];
|
||||
[self.session addOutput:self.metadataOutput];
|
||||
[self.metadataOutput setMetadataObjectsDelegate:self queue:dispatch_get_main_queue()];
|
||||
[self.metadataOutput setMetadataObjectTypes:[self.metadataOutput availableMetadataObjectTypes]];
|
||||
}
|
||||
[self.session commitConfiguration];
|
||||
}
|
||||
|
||||
-(void)handleCameraPermission {
|
||||
|
||||
switch ( [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo] )
|
||||
|
|
Loading…
Reference in New Issue