Using different methods other than "selection" don't help either.
However, it activates fine on button press on my Android device (which seems to fall back to vibration & doesn't have haptic feedback).
At one point I glanced at my Xcode logs and surprisingly saw some non-React-Native logs, 3 or 4 of which were related to the haptics engine not starting. One of them said react-native-haptic-feedback failed to prewarm core haptics engine. Google shows absolutely 0 results for this error.
Off to ugly old React Native Vibrate I guess...
UPDATE: The exact same bug occurs with Vibration.vibrate() too! 😵💫 It works fine outside of an onPress event, but as soon as it's implemented into an onPress, it does nothing. This issue is documented by others here. I think this issue is rooted in a React Native bug, potentially conflicting with libraries or environment setup...
UPDATE 2: Just created a brand new React Native project on the latest React Native (0.66.0). With the below code, onPress={ReactNativeHapticFeedback.trigger("selection")} activates when I open the app, but not when I press the button! 🤯 Same exact behavior with Vibration.vibrate() (except it vibrates when the app is launched instead of doing the haptic feedback of course), so I think it's a React Native issue, rather than this library's.
The
ReactNativeHapticFeedback.trigger()
only activates if outside a function (based on limited testing). I want it to activate on button press.For example, this works:
...but these don't:
Using options such as below does not help:
Using different methods other than
"selection"
don't help either.However, it activates fine on button press on my Android device (which seems to fall back to vibration & doesn't have haptic feedback).
At one point I glanced at my Xcode logs and surprisingly saw some non-React-Native logs, 3 or 4 of which were related to the haptics engine not starting. One of them said
react-native-haptic-feedback failed to prewarm core haptics engine
. Google shows absolutely 0 results for this error.Off to ugly old React Native Vibrate I guess...
UPDATE: The exact same bug occurs with
Vibration.vibrate()
too! 😵💫 It works fine outside of anonPress
event, but as soon as it's implemented into anonPress
, it does nothing. This issue is documented by others here. I think this issue is rooted in a React Native bug, potentially conflicting with libraries or environment setup...iOS 14.8 | React Native 0.64.2
Cross-reference to
react-native
Vibration.vibrate()
issue: https://github.com/facebook/react-native/issues/23404#issuecomment-934880420UPDATE 2: Just created a brand new React Native project on the latest React Native (0.66.0). With the below code,
onPress={ReactNativeHapticFeedback.trigger("selection")}
activates when I open the app, but not when I press the button! 🤯 Same exact behavior withVibration.vibrate()
(except it vibrates when the app is launched instead of doing the haptic feedback of course), so I think it's a React Native issue, rather than this library's.iOS 14.8 | React Native 0.66.0
New facebook/react-native GitHub issue opened by me