Download the PHP package nativephp/mobile-device without Composer
On this page you can find all versions of the php package nativephp/mobile-device. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nativephp/mobile-device
More information about nativephp/mobile-device
Files in nativephp/mobile-device
Package mobile-device
Short Description Device hardware operations for NativePHP Mobile
License MIT
Informations about the package mobile-device
Device Plugin for NativePHP Mobile
Device hardware operations including vibration, flashlight, device info, and battery status.
Overview
The Device API provides access to device hardware features and information.
Installation
Usage
PHP (Livewire/Blade)
JavaScript (Vue/React/Inertia)
Methods
vibrate(): array
Vibrate the device.
Returns: { success: true }
toggleFlashlight(): array
Toggle the device flashlight on/off.
Returns: { success: boolean, state: boolean }
getId(): array
Get the unique device identifier.
Returns: { id: string }
- iOS: Uses
identifierForVendorUUID - Android: Uses
ANDROID_ID
getInfo(): array
Get detailed device information.
Returns: { info: string } (JSON string)
Device info includes:
name- Device namemodel- Device modelplatform- "ios" or "android"operatingSystem- OS nameosVersion- OS version stringmanufacturer- Device manufacturerlanguage- Device language as BCP 47 tag (e.g. "en-US")isVirtual- Whether running in simulator/emulatormemUsed- Memory usage in byteswebViewVersion- WebView version
getBatteryInfo(): array
Get battery level and charging status.
Returns: { info: string } (JSON string)
Battery info includes:
batteryLevel- Battery level from 0.0 to 1.0isCharging- Whether device is charging
Permissions
Android
android.permission.VIBRATE- For vibrationandroid.permission.FLASHLIGHT- For flashlight control
iOS
No special permissions required.