expo-haptics
provides haptic (touch) feedback for[[UIDevice currentDevice] valueForKey: @"_feedbackSupportLevel"]
so this is not added in ExpoConstants.platform.ios.systemVersion
or Constants.platform.ios.platform
Android Device | Android Emulator | iOS Device | iOS Simulator | Web |
---|---|---|---|---|
→
expo install expo-haptics
If you're installing this in a bare React Native app, you should also follow these additional installation instructions.
VIBRATE
permission is added automatically.import * as Haptics from 'expo-haptics';
ImpactFeedbackStyle
) - A collision indicator that on iOS is directly mapped to UIImpactFeedbackStyle
,
while on Android these are simulated using Vibrator.
You can use one of Haptics.ImpactFeedbackStyle.{Light, Medium, Heavy}
.NotificationFeedbackType
) - A notification feedback type that on iOS is directly mapped to UINotificationFeedbackType,
while on Android these are simulated using Vibrator.
You can use one of Haptics.NotificationFeedbackType.{Success, Warning, Error}
.The kind of notification response used in the feedback.
Used to let a user know when a selection change has been registered.
The mass of the objects in the collision simulated by a UIImpactFeedbackGenerator object
UINotificationFeedbackStyle
Heavy
- A collision between large, heavy user interface elements.ImpactFeedbackStyle.Heavy = "heavy"
Light
- A collision between small, light user interface elements.ImpactFeedbackStyle.Light = "light"
Medium
- A collision between moderately sized user interface elements.ImpactFeedbackStyle.Medium = "medium"
The type of notification feedback generated by a UINotificationFeedbackGenerator object.
UINotificationFeedbackType
Error
- A notification feedback type indicating that a task has failed.NotificationFeedbackType.Error = "error"
Success
- A notification feedback type indicating that a task has completed successfully.NotificationFeedbackType.Success = "success"
Warning
- A notification feedback type indicating that a task has produced a warning.NotificationFeedbackType.Warning = "warning"