ConstVibrate the device for a specific duration and amplitude.
Vibration duration in milliseconds (default: 500ms)
Vibration strength 1-255, or -1 for device default
ok: false if amplitude is out of range. Otherwise ok: true once the command is sent,
even on a device without a vibrator.
Vibrate the device with a custom pattern
Pulse durations (ms) in [wait, vibrate, wait, vibrate, ...] format.
Optionalintensities: number[]Optional vibration strengths (0-255). If provided, must be the same length as the pattern array.
A promise that resolves when the vibration command is sent.
Check whether the device has a vibrator.
true if the device has a vibrator. false if it does not, or if the check fails.
Check whether the device can vibrate at a chosen strength, which vibrate's amplitude and
vibrateWithPattern's intensities need.
true if the device supports amplitude control. false if it does not, or if the check fails.
Check whether the device supports custom vibration patterns, as used by vibrateWithPattern.
true if custom patterns are supported. false if they are not, or if the check fails.
Provides haptic feedback control for the device. Requires the vibration plugin to be enabled
in the app configuration.
vibrate returns ok as soon as the command is sent. It does not report whether the device
has a vibrator. Call Vibration.hasVibrator first when that matters.
Device vibration plugin.