Rock Mobile Docs

Please login to access all of the features of the Community Site.

PerformHapticFeedback

Mobile3.0

Performs haptic feedback, a short vibration, on the person's device. See the .NET MAUI haptic feedback docs for how each type feels on iOS and Android.

The CommandParameter is a string, but can be left out unless you specifically want to implement the "LongPress" type. Everything else will default to the "Click" type.

Properties

PropertyTypeDescription
HapticFeedbackTypestringThe type of haptic feedback you want to implement. Only two accepted values are "Click" or "LongPress".

Examples

<!-- Example with no command parameter. Defaults to "Click". -->
<Button Text="Haptic"
    Command="{Binding PerformHapticFeedback}" />
<!-- Example with the "LongPress" command parameter. -->
<Button Text="Haptic LongPress"
    Command="{Binding PerformHapticFeedback}"
    CommandParameter="LongPress" />
  • ShowToast shows a short message that goes away on its own.