From 3bed9df9bc08b691f6b01cc4914d005cff337586 Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Wed, 29 Apr 2026 01:27:45 -0400 Subject: [PATCH] fix(mobile): use Android-native haptics API instead of Vibrator Use performAndroidHapticsAsync on Android which uses HapticFeedbackConstants instead of the Vibrator API. This fixes haptics not working on Android and removes the VIBRATE permission requirement. Co-authored-by: Orca --- mobile/src/platform/haptics.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mobile/src/platform/haptics.ts b/mobile/src/platform/haptics.ts index f26a6b841c1..72bf2443a82 100644 --- a/mobile/src/platform/haptics.ts +++ b/mobile/src/platform/haptics.ts @@ -1,7 +1,13 @@ +import { Platform } from 'react-native' import * as Haptics from 'expo-haptics' export function triggerMediumImpact(): void { - void Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium).catch(() => { - // Why: Expo haptics can be unavailable on some Android builds/emulators. - }) + if (Platform.OS === 'android') { + // Why: Android's Vibrator API (used by impactAsync) is unreliable for haptic + // feedback. performAndroidHapticsAsync uses the native HapticFeedbackConstants + // API which works without VIBRATE permission and feels more natural. + void Haptics.performAndroidHapticsAsync(Haptics.AndroidHaptics.Long_Press).catch(() => {}) + } else { + void Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Medium).catch(() => {}) + } }