react-native-haptic-feedback icon indicating copy to clipboard operation
react-native-haptic-feedback copied to clipboard

[iOs] haptic feedback does not working if mic on

Open ysimoo opened this issue 4 years ago • 3 comments

Hello,

Is there any solution to use haptic feedback when mic is active on iOs ?

React-Native: 0.63.4 expo: 42.0.1

`const options = { enableVibrateFallback: true, ignoreAndroidSystemSettings: false, };

ReactNativeHapticFeedback.trigger("selection", options); `

Thanks,

ysimoo avatar Oct 26 '21 15:10 ysimoo

Will check for the circumstance

mkuczera avatar Nov 24 '21 13:11 mkuczera

I had the same experience using in conjunction with react-native-audio-recorder-player, and found that wrapping my record function in a setTimeout resolved the issue:

            ReactNativeHapticFeedback.trigger('impactHeavy');

            setTimeout(() => {
              startRecording();
            });

jforaker avatar Jan 08 '22 20:01 jforaker

Natively on iOS haptic feedback is disabled during audio recording sessions not to interrupt it. Still, you can enable with

if #available(iOS 13, *) {
              do {
                    try AVAudioSession.sharedInstance().setAllowHapticsAndSystemSoundsDuringRecording(true)
                } catch {}
            }

inside the startRecording function of native source RNAudioRecorderPlayer.swift file below the settings.

image

a-vikor avatar Jun 23 '23 15:06 a-vikor