Open FoundersApproach opened 3 months ago
Guten Tag, Hans here.
[!NOTE] New features, bugfixes, updates and other improvements are all handled mostly by
@mrousavy
in his free time. To support@mrousavy
, please consider 💖 sponsoring him on GitHub 💖. Sponsored issues will be prioritized.
@FoundersApproach We're seeing a similar issue on iOS 16+. On iOS <= 15 the green dot showing the camera is active never goes away. Can you try capturing the "goBack" and then using setTimeout to set the camera in-active prior to going back?
Something like this:
const delayedGoBack = useCallback(() => {
setCameraActive(false)
setTimeout(() => navigation.goBack(), 10)
}, [])
Note: Would need to disable back gestures in order to make sure navigating back is always captured.
Looks like this specific line keeps the phone from going to sleep. It doesn't appear that this is implemented on Android for VC.
Perhaps this should just be removed? Idle management could be left to library consumers. This would benefit Expo users, especially, which uses keep-awake
to allow stacked calls to hold and release wake lock / idle timer setting.
What's happening?
Once camera library loads in one screen and going back to previous screen in stack navigation then app unable to goes to sleep. May be camera reference object is unable to let app sleep ?
I did some object reference clearance in component unmount but no luck. Please help!
Reproduceable Code
Relevant log output
Camera Device
Device
iPhone 14 plus (ios 17.1.1)
VisionCamera Version
"react-native-vision-camera": "^3.9.2"
Can you reproduce this issue in the VisionCamera Example app?
Yes, I can reproduce the same issue in the Example app here
Additional information