Mobile Haptics

GrayMatter Technology

AuthorGrayMatter TechnologyPlugin TypeCommunity PluginPriceFreeVersionvlatestLicenseMIT
NativePHP^3.0PHP^8.2Laravel11 | 12iOSanyAndroidany

Haptic feedback plugin for NativePHP Mobile — impact, notification, selection, raw vibrate, and custom patterns. Uses native iOS UIFeedbackGenerator and Android VibrationEffect.

Features

  • 5 haptic types: impact, notification, selection, raw vibrate, custom pattern
  • PHP and JavaScript APIs
  • Graceful degradation on simulators or missing hardware (returns false)
  • Zero config — install and use, no publish or migrations needed

Installation

composer require graymatter/nativephp-mobile-haptics

Usage (PHP)

use GrayMatter\NativePHP\Mobile\Haptics\Facades\Haptics;

Haptics::impact('light');          // light, medium, heavy, rigid, soft
Haptics::notification('success');  // success, warning, error
Haptics::selection();
Haptics::vibrate(300);             // milliseconds
Haptics::pattern([100, 50, 200, 50, 100]);

Usage (JavaScript)

import { haptics } from '@graymatter/nativephp-mobile-haptics';

await haptics.impact('heavy');
await haptics.notification('error');
await haptics.selection();
await haptics.vibrate(200);
await haptics.pattern([100, 50, 200]);

All methods return bool — true on success, false on failure or missing hardware.