Download the PHP package blessedzulu/nativephp-mobile-haptics without Composer
On this page you can find all versions of the php package blessedzulu/nativephp-mobile-haptics. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package nativephp-mobile-haptics
NativePHP Mobile Haptics
Haptic feedback plugin for NativePHP Mobile — impact, notification, selection, vibrate & pattern.
Fork of graymatter/nativephp-mobile-haptics, modernised for Laravel 13 (widened
illuminate/supportconstraint) and fixed to send the{ method, params }body shape NativePHP core's/_native/api/callactually expects. All credit for the original implementation goes to GrayMatter.
Features
- 5 haptic types: impact, notification, selection, raw vibrate, and custom patterns
- Cross-platform: native iOS (
UIFeedbackGenerator) and Android (VibrationEffect) implementations - PHP + JavaScript: use from Livewire/Blade or Vue/React/Inertia
- Graceful degradation: returns
falseon simulators or missing hardware - Zero config: install and use — no publish, no migrations
Requirements
- PHP 8.2+
- Laravel 11, 12 or 13
- NativePHP Mobile 3.0+
Installation
The service provider and facade are auto-discovered.
Usage (PHP)
All methods return bool — true on success, false on failure or missing hardware.
Usage (JavaScript)
Or import individual functions:
API Reference
| Method | Parameters | Default | Description |
|---|---|---|---|
impact($style) |
light, medium, heavy, rigid, soft |
medium |
Impact haptic feedback |
notification($type) |
success, warning, error |
success |
Notification haptic feedback |
selection() |
— | — | Selection tick feedback |
vibrate($ms) |
1–5000 |
200 |
Raw vibration in milliseconds |
pattern($array) |
[vibrate, pause, ...] |
— | Custom vibration pattern |
Platform Differences
| Feature | iOS | Android |
|---|---|---|
| Impact | Native (UIImpactFeedbackGenerator) |
Native (VibrationEffect.createOneShot) |
| Notification | Native (UINotificationFeedbackGenerator) |
Native (predefined effects API 29+, waveform fallback) |
| Selection | Native (UISelectionFeedbackGenerator) |
Native (EFFECT_TICK API 29+, short vibration fallback) |
| Vibrate | Approximated via repeated impacts | Native (createOneShot) |
| Pattern | Approximated via timed impacts | Native (createWaveform) |
| Permission | None required | VIBRATE (auto-granted) |
| Min version | iOS 13.0 | API 26 (Android 8.0) |
Disabling Haptics
Use standard conditional logic:
Testing
License
MIT — see LICENSE.
All versions of nativephp-mobile-haptics with dependencies
illuminate/support Version ^11.0|^12.0|^13.0
nativephp/mobile Version ^3.0