Instant Games

Haptic Feedback

Updated: Jun 28, 2026
Copy for LLM
Haptic feedback allows your Instant Game to trigger physical vibrations on the player’s device at key moments during gameplay. A short vibration when a player scores, a subtle pulse when they tap a button, or a distinct buzz when something goes wrong—these small physical cues make your game feel more responsive and tactile.
This guide covers what haptic feedback is, why you should use it, how to integrate it using the Instant Games SDK, supported patterns and devices, and best practices for effective haptic design.

What is haptic feedback?

Haptic feedback (sometimes called “haptics” or “tactile feedback”) is a technology that uses vibrations or motions to communicate with the user through the sense of touch. On mobile devices, this is typically achieved through a vibration motor built into the phone or tablet.
In the context of Instant Games, haptic feedback provides a physical sensation that accompanies an on-screen event. For example:
  • A quick tap when the player presses a button.
  • A light vibration when the player collects a coin or power-up.
  • A strong buzz when the player takes damage or loses a life.
  • A celebratory pattern when the player achieves a high score or completes a level.
Haptic feedback is a complement to visual and audio feedback, not a replacement. It adds a layer of physicality to the experience that makes the game feel more tangible and rewarding.

Why use haptic feedback?

Enhanced player experience

Studies consistently show that haptic feedback increases player engagement and satisfaction. A game that “feels” responsive in your hands creates a stronger emotional connection than one that relies on sight and sound alone.

Better feedback loops

Games are built on feedback loops—the player performs an action, and the game responds. Haptic feedback tightens this loop by adding an immediate, physical response that the player perceives even faster than visual or audio cues. This is especially valuable for:
  • Confirming that a tap or swipe was registered.
  • Signaling success, failure, or critical events.
  • Reinforcing the rhythm of gameplay in action or music games.

Accessibility

Haptic feedback provides an additional channel for communicating game events, which can be helpful for players who have difficulty perceiving visual or audio cues.

Competitive advantage

Many Instant Games do not use haptic feedback. Adding it to your game is a relatively small effort that can meaningfully differentiate your game from others and contribute to higher quality review scores.

How to trigger haptic feedback

The performHapticFeedbackAsync() method

The Instant Games SDK provides a single method for triggering haptic feedback:
FBInstant.performHapticFeedbackAsync();
This method triggers the device’s default haptic feedback pattern. It returns a Promise that resolves when the haptic feedback has been triggered (or silently resolves if the device does not support haptics).

Basic example

// Trigger haptic feedback when the player scores
function onPlayerScored(points) {
  updateScore(points);
  showScoreAnimation(points);

  // Trigger a vibration to reinforce the scoring moment
  FBInstant.performHapticFeedbackAsync().catch(error => {
    // Haptic feedback is not critical -- log the error and continue
    console.warn('Haptic feedback failed:', error);
  });
}

Using async/await

async function onPlayerScored(points) {
  updateScore(points);
  showScoreAnimation(points);

  try {
    await FBInstant.performHapticFeedbackAsync();
  } catch (error) {
    // Haptic feedback is not critical -- silently handle the error
    console.warn('Haptic feedback failed:', error);
  }
}

Fire-and-forget pattern

Because haptic feedback is a non-critical enhancement, you can call it without awaiting the result. This avoids any potential delay in gameplay logic.
function onPlayerScored(points) {
  updateScore(points);
  showScoreAnimation(points);

  // Fire and forget -- do not await
  FBInstant.performHapticFeedbackAsync().catch(() => {});
}
This pattern is perfectly acceptable. The haptic feedback will still trigger on supported devices, and your game logic will not be affected if it fails.

Supported haptic types

The performHapticFeedbackAsync() method triggers the platform’s default haptic pattern. The exact sensation varies by device:
  • iOS devices: Uses the system’s default haptic engine (Taptic Engine). The feedback is a short, clean tap similar to the haptic you feel when toggling a switch or receiving a notification.
  • Android devices: Uses the device’s vibration motor. The feedback is a brief vibration. The intensity and quality vary by device manufacturer and model.
At this time, the Instant Games SDK does not provide options to specify custom vibration patterns, durations, or intensities. The haptic feedback is a single, standardized event. If you need different “strengths” of feedback for different events, you can simulate this by calling the method multiple times with short delays:
// Simulate a stronger haptic effect by triggering multiple pulses
async function strongHapticFeedback() {
  await FBInstant.performHapticFeedbackAsync().catch(() => {});
  await new Promise(resolve => setTimeout(resolve, 80));
  await FBInstant.performHapticFeedbackAsync().catch(() => {});
}

// Simulate a celebratory pattern with three quick pulses
async function celebrationHapticFeedback() {
  for (let i = 0; i < 3; i++) {
    await FBInstant.performHapticFeedbackAsync().catch(() => {});
    if (i < 2) {
      await new Promise(resolve => setTimeout(resolve, 100));
    }
  }
}
Note: Use multi-pulse patterns sparingly. Excessive vibration can be annoying and drain the device’s battery faster.

Device support and fallback behavior

Supported devices

Haptic feedback is supported on:
  • iOS devices with a Taptic Engine (iPhone 7 and later).
  • Android devices with a vibration motor (most modern Android phones).

Unsupported devices

On devices or platforms that do not support haptic feedback (such as desktop browsers, older phones without vibration hardware, or tablets without haptic motors), performHapticFeedbackAsync() will resolve silently without triggering any physical feedback. It will not throw an error.
This means you do not need to add device detection logic before calling the method. You can call it unconditionally, and it will simply do nothing on unsupported devices.

Checking for support

If you want to conditionally show haptic-related UI (for example, a “vibration on/off” toggle in your settings menu), you can check for support using the SDK:
// Check if the current device supports haptic feedback
function isHapticFeedbackSupported() {
  return FBInstant.getSupportedAPIs().includes(
    'performHapticFeedbackAsync'
  );
}

// Only show the vibration toggle if haptics are supported
if (isHapticFeedbackSupported()) {
  showVibrationSettingsToggle();
}

User settings

Some players may have disabled vibration at the system level in their device settings. In these cases, performHapticFeedbackAsync() will resolve without producing feedback, and there is no way for your game to override the user’s system preference. This is expected and correct behavior—always respect the player’s device settings.

Code examples

Example 1: Button press feedback

Add haptic feedback to button taps to make the UI feel more responsive.
function onButtonPressed(buttonId) {
  // Trigger haptic feedback immediately on press
  FBInstant.performHapticFeedbackAsync().catch(() => {});

  // Handle the button action
  switch (buttonId) {
    case 'play':
      startGame();
      break;
    case 'settings':
      openSettings();
      break;
    case 'share':
      shareScore();
      break;
  }
}

Example 2: Collision or impact feedback

In an action game, trigger haptic feedback when the player’s character collides with an obstacle or enemy.
function onCollision(object) {
  // Visual feedback
  showCollisionEffect(object.position);

  // Audio feedback
  playSound('collision');

  // Haptic feedback
  FBInstant.performHapticFeedbackAsync().catch(() => {});

  // Game logic
  reducePlayerHealth(object.damage);

  if (getPlayerHealth() <= 0) {
    onGameOver();
  }
}

Example 3: Level complete celebration

Use multiple haptic pulses to create a celebratory feeling when the player completes a level.
async function onLevelComplete(levelNumber, score) {
  // Show level complete animation
  showLevelCompleteScreen(levelNumber, score);

  // Play celebration sound
  playSound('level_complete');

  // Celebratory haptic pattern (three quick pulses)
  for (let i = 0; i < 3; i++) {
    FBInstant.performHapticFeedbackAsync().catch(() => {});
    await new Promise(resolve => setTimeout(resolve, 120));
  }

  // Save progress
  await savePlayerProgress(levelNumber + 1);
}

Example 4: Countdown timer feedback

In a timed game, use haptic feedback to signal that time is running out.
function onTimerTick(secondsRemaining) {
  updateTimerDisplay(secondsRemaining);

  // Haptic pulse during the last 5 seconds to build tension
  if (secondsRemaining <= 5 && secondsRemaining > 0) {
    FBInstant.performHapticFeedbackAsync().catch(() => {});
  }
}

Example 5: Providing a vibration setting

Allow players to control whether haptic feedback is enabled in your game.
let hapticEnabled = true;

function setHapticEnabled(enabled) {
  hapticEnabled = enabled;
  // Persist the setting
  FBInstant.player.setDataAsync({ hapticEnabled: enabled }).catch(() => {});
}

async function loadHapticSetting() {
  try {
    const data = await FBInstant.player.getDataAsync(['hapticEnabled']);
    if (data.hapticEnabled !== undefined) {
      hapticEnabled = data.hapticEnabled;
    }
  } catch (error) {
    // Default to enabled
    hapticEnabled = true;
  }
}

function triggerHaptic() {
  if (hapticEnabled) {
    FBInstant.performHapticFeedbackAsync().catch(() => {});
  }
}

Best practices

Use haptic feedback at impactful moments

Haptic feedback is most effective when it reinforces meaningful game events. Good candidates include:
  • Scoring: The player collects a coin, scores a goal, or earns points.
  • Achievements: The player unlocks an achievement, completes a level, or reaches a milestone.
  • Impacts: The player’s character collides with something, takes damage, or fires a weapon.
  • Critical UI interactions: The player taps an important button (play, purchase, confirm).
  • Timing cues: A countdown reaching zero, a turn timer expiring, or a rhythm game beat.

Use it sparingly

Less is more. If every small action triggers a vibration, the feedback becomes noise rather than a meaningful signal. Reserve haptic feedback for moments that matter. A good rule of thumb: if you would not also play a sound effect for the event, you probably should not trigger haptics for it either.

Never use haptics as the only feedback channel

Haptic feedback should always be paired with visual feedback (and often audio feedback as well). Some players are on devices that do not support haptics, some have vibration disabled, and some simply may not notice a subtle vibration. Always ensure the game is fully playable and understandable without haptics.

Handle errors silently

performHapticFeedbackAsync() can fail for various reasons (unsupported device, user settings, platform restrictions). Always catch and handle errors silently. Haptic feedback is an enhancement—it should never cause your game to crash or display error messages.
// Always include error handling
FBInstant.performHapticFeedbackAsync().catch(() => {});

Respect player preferences

Consider providing an in-game toggle that lets players turn haptic feedback on or off. While the system-level vibration setting will be respected automatically, an in-game toggle gives players more granular control and shows that you care about their experience.

Test on real devices

The sensation of haptic feedback cannot be evaluated in a browser developer tools emulator or on a desktop computer. Always test your haptic implementation on real mobile devices to verify that:
  • The feedback triggers at the correct moments.
  • The intensity feels appropriate and not excessive.
  • The timing aligns with the visual and audio feedback.
  • The game works correctly on devices where haptics are not supported.

Consider battery impact

Haptic feedback uses the device’s vibration motor, which consumes battery. While a single haptic event uses very little power, triggering haptics hundreds of times per minute (for example, on every frame of an animation) could noticeably affect battery life. Keep haptic events infrequent and purposeful.

Limitations

  • Single pattern only: The SDK provides one haptic feedback pattern. You cannot specify custom vibration durations, intensities, or waveforms through the SDK.
  • No synchronous API:performHapticFeedbackAsync() is asynchronous. While the delay is typically imperceptible, it is not suitable for frame-precise feedback in extremely timing-sensitive scenarios.
  • Device variability: The quality and intensity of haptic feedback varies significantly across devices. A vibration that feels subtle on an iPhone may feel harsh on a budget Android phone, or vice versa.
  • Platform restrictions: Haptic feedback is only available on mobile devices. Desktop and web players will not receive any haptic feedback.
  • User override: If the player has disabled vibration at the system level, haptic feedback will not work regardless of your game’s settings. This is by design and should be respected.

SDK version requirement

Haptic feedback requires Instant Games SDK v6.2 or later. Ensure you are loading a compatible SDK version:
<script src="https://connect.facebook.net/en_US/fbinstant.8.0.js"></script>
To verify that the API is available at runtime:
const supported = FBInstant.getSupportedAPIs().includes('performHapticFeedbackAsync');

Next steps

  • SDK Reference -- Full API reference for the Instant Games SDK.
  • Best Practices -- General best practices for building successful Instant Games.
  • Game Performance -- Optimize your game for fast loading and smooth gameplay.