System-level operations for NativePHP Mobile apps.
The System API provides access to system-level functionality like platform detection and opening the app's settings page.
composer require nativephp/mobile-systemuse Native\Mobile\Facades\System; // Platform detection System::isIos(); // true on iOS System::isAndroid(); // true on Android System::isMobile(); // true on either platform // Open app settings (useful when user denied permissions) System::appSettings(); // Toggle the flashlight System::flashlight();import { System } from '#nativephp'; // Open app settings await System.openAppSettings();Returns true if the app is running on iOS.
Returns true if the app is running on Android.
Returns true if the app is running on iOS or Android.
Opens the app's settings screen in the device settings. This is useful when a user has denied a permission and you want to direct them to the settings to grant it.
Toggles the device flashlight on/off.
- Detect the current platform to conditionally render UI
- Direct users to grant permissions after initial denial
- Allow users to change notification preferences
MIT