-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
🐛 [iOS] Camera always alive even after Camera component is unmounted #3225
Comments
Guten Tag, Hans here! 🍻 Thanks for your detailed report! It looks like you have a valid concern with the You can gather logs by running your app in Xcode and checking the console output. If you share those logs, it will greatly help in troubleshooting the issue. Also, it would be beneficial if you could check whether you can reproduce this issue in the VisionCamera Example app, as that info is quite essential. Feel free to update the issue with the logs, and we'll look into it further!
|
Please help me take a look. I have also provided the reproduceable code. @mrousavy |
No. You didn't provide logs, which is the most important detail here. Can't help you. |
I believe this is a dupe of this issue. Below is a patch to diff --git a/node_modules/react-native-vision-camera/ios/React/CameraView.swift b/node_modules/react-native-vision-camera/ios/React/CameraView.swift
index 6b85538..0cbfd44 100644
--- a/node_modules/react-native-vision-camera/ios/React/CameraView.swift
+++ b/node_modules/react-native-vision-camera/ios/React/CameraView.swift
@@ -278,7 +278,9 @@ public final class CameraView: UIView, CameraSessionDelegate, PreviewViewDelegat
}
// Prevent phone from going to sleep
- UIApplication.shared.isIdleTimerDisabled = isActive
+ // Remove this line and instead rely on expo keep-awake.
+ // See: https://github.com/mrousavy/react-native-vision-camera/issues/3041#issuecomment-2263720909
+ // UIApplication.shared.isIdleTimerDisabled = isActive
}
func updatePreview() { |
this patch does not work. The main reason that the ref: #3041 (comment) |
Look like this same exact issue still exist until now: #905 By the way, since I am using react-navigation. The workaround is to delay the goBack navigations. const onPressClose = () => {
setIsCameraActive(false)
setTimeout(() => goBack(), 10);
} Side note: Thanks for the awesome library. ❤️ |
What's happening?
When I unmount the
Camera
component. The device camera is still active behind the scene. Below is the screenshot and video.[Video]
vision-camera-video-480.mov
[Image]
Reproduceable Code
Relevant log output
Camera Device
Device
iPhone XS
VisionCamera Version
4.5.3
Can you reproduce this issue in the VisionCamera Example app?
I didn't try (⚠️ your issue might get ignored & closed if you don't try this)
Additional information
The text was updated successfully, but these errors were encountered: