nativephp/mobile-system

System-level operations for NativePHP Mobile

Maintainers

Package info

github.com/NativePHP/mobile-system

Language:Kotlin

Type:nativephp-plugin

pkg:composer/nativephp/mobile-system

Statistics

Installs: 732

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

1.0.1 2026-03-12 22:11 UTC

This package is auto-updated.

Last update: 2026-03-12 22:13:22 UTC


README

System-level operations for NativePHP Mobile apps.

Overview

The System API provides access to system-level functionality like platform detection and opening the app's settings page.

Installation

composer require nativephp/mobile-system

Usage

PHP (Livewire/Blade)

use 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();

JavaScript (Vue/React/Inertia)

import { System } from '#nativephp';

// Open app settings
await System.openAppSettings();

Methods

isIos(): bool

Returns true if the app is running on iOS.

isAndroid(): bool

Returns true if the app is running on Android.

isMobile(): bool

Returns true if the app is running on iOS or Android.

appSettings(): void

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.

flashlight(): void

Toggles the device flashlight on/off.

Use Cases

  • Detect the current platform to conditionally render UI
  • Direct users to grant permissions after initial denial
  • Allow users to change notification preferences

License

MIT