Skip to content
This repository was archived by the owner on Jun 16, 2023. It is now read-only.

Commit 79698b8

Browse files
committed
fix(focusWarning): fix focus depth warning being shown for ios.
1 parent 4b8a424 commit 79698b8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: ios/RN/RNCamera.m

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ - (id)initWithBridge:(RCTBridge *)bridge
4949
selector:@selector(orientationChanged:)
5050
name:UIDeviceOrientationDidChangeNotification
5151
object:nil];
52+
self.autoFocus = -1;
5253
// [[NSNotificationCenter defaultCenter] addObserver:self
5354
// selector:@selector(bridgeDidForeground:)
5455
// name:EX_UNVERSIONED(@"EXKernelBridgeDidForegroundNotification")
@@ -209,7 +210,7 @@ - (void)updateFocusDepth
209210
AVCaptureDevice *device = [self.videoCaptureDeviceInput device];
210211
NSError *error = nil;
211212

212-
if (device.focusMode != RNCameraAutoFocusOff) {
213+
if (self.autoFocus < 0 || device.focusMode != RNCameraAutoFocusOff) {
213214
return;
214215
}
215216

0 commit comments

Comments
 (0)