Instant Games now support haptic feedback. This feature is supported on Android and iOS devices that have an integrated vibrator. The feedback produced by iOS devices slightly differs from that of Android devices.
VibrationEffect.DEFAULT_AMPLITUDE
.UIImpactFeedbackGenerator
, initialized with a style of
UIImpactFeedbackStyleHeavy
.In other words, Android’s feedback lasts a split second longer than that of iOS and tends to be slightly more noticeable.
Requests the user's device to perform a haptic feedback (making the device vibrate). This API call will only work on devices with an integrated vibrator. This feature is now available on Instant Games for Android and iOS.
Examples
FBInstant.performHapticFeedbackAsync() .then(function() { ... });
Returns Promise A promise that resolves when the haptic feedback call has been correctly requested.