System-level operations for NativePHP Mobile apps.
The System API provides access to system-level functionality like opening the app's settings page.
composer require nativephp/mobile-systemuse Native\Mobile\Facades\System;
// Open app settings (useful when user denied permissions)
System::openAppSettings();import { system } from '#nativephp';
// Open app settings
await system.openAppSettings();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.
Returns: { success: true }
use Native\Mobile\Facades\Camera;
use Native\Mobile\Facades\System;
public function takePhoto()
{
$result = Camera::getPhoto();
if (isset($result['error']) && str_contains($result['error'], 'permission')) {
// Permission denied, offer to open settings
$this->showPermissionDialog = true;
}
}
public function openSettings()
{
System::openAppSettings();
}MIT