react-native-camera-kit icon indicating copy to clipboard operation
react-native-camera-kit copied to clipboard

torchMode={"on"} does not work on startup (iOS)

Open cixio opened this issue 2 years ago • 4 comments

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?

cixio avatar Oct 03 '23 19:10 cixio

Ever find a solution for this? I am having this problem

dleavittpmc avatar Nov 01 '23 05:11 dleavittpmc

Check out this issue: https://github.com/teslamotors/react-native-camera-kit/issues/518

The work around was great for me.

dleavittpmc avatar Nov 01 '23 05:11 dleavittpmc

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.

cixio avatar Nov 01 '23 20:11 cixio

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?

cixio avatar Nov 02 '23 11:11 cixio

Still an issue on v14.2.0.

@cixio your workaround worked for me too. iPhone 13 Pro.

lukebars avatar Mar 04 '25 17:03 lukebars

Fixed in v16.1.2.

scarlac avatar Sep 10 '25 01:09 scarlac