react-native-camera-kit
react-native-camera-kit copied to clipboard
torchMode={"on"} does not work on startup (iOS)
Describe the bug see title, sometimes the light flashes half a second but then stays off. using a button as switch works great.
To Reproduce set torchMode={"on"} on iOS 17.0.2 (iPhone 14 pro)
Expected behavior light goes on and stays on
Additional context using 14.0.0-beta11 for dual back camera, maybe here is the problem?
Ever find a solution for this? I am having this problem
Check out this issue: https://github.com/teslamotors/react-native-camera-kit/issues/518
The work around was great for me.
I use a similar workaround, as you mentioned. I'm quite certain that this is also related to a timing issue, possibly appeared with the introduction of support for dual cameras. I attempted to address it, but so far, I haven't been successful in resolving the issue. Once I manage to fix it, I'll submit a pull request, but I'm not actively working on this bug at the moment.
Just played around a little bit, when removing this line:
https://github.com/teslamotors/react-native-camera-kit/blob/11b116c38658cbc5e52f82926dc5a56c0c94625a/ios/ReactNativeCameraKit/RealCamera.swift#L114
Everything works great on my iPhone 14 Pro. I can not retrace what causes the bug, but it seems that the reapply of the configuration (comment in line above) is not necessary (any more?) - can you confirm other devices?
Still an issue on v14.2.0.
@cixio your workaround worked for me too. iPhone 13 Pro.
Fixed in v16.1.2.