ludo / react-native-torch

Torch (flashlight) plugin for React Native (Android/iOS)
MIT License
78 stars 27 forks source link

Switch state doesn't work #15

Open kapilpau opened 5 years ago

kapilpau commented 5 years ago

On both Android and iOS, when trying to switch state, I get: TypeError: undefined is not an object (evaluating 'u.switchState')

I get the error if I try to import TorchWithPermissionCheck or Torch from 'react-native-torch' and then run Torch.switchState(true)

Jlexyc commented 5 years ago

UPD: There no automatic linking. You have to add native module manually to your native project settings.

Original: The same issue on my side. Will try to debug

wandersage commented 4 years ago

have the same issue on iOS. android works fine. react-native: 0.61.2 . used linking command manually. for ios project imported as a pod. TypeError: null is not an object (evaluating '_reactNativeTorch.default.switchState')

UPD: It's start working after cleaning cache in Xcode and pod install command.