Background Tasks
Bifrost Technology
NativePHP^3.2.1iOS16.0+Android26+
Schedule and run artisan commands in the background on iOS and Android using platform-native schedulers (WorkManager on Android, BGTaskScheduler on iOS).
Features
- Scheduled artisan command execution on iOS and Android
- Independent task scheduling with individual intervals
- Device constraint support (network, charging, battery, storage, idle states)
- Long-running task capability for extended operations
- Cold boot handling with transparent PHP process management
Installation
Requires Composer credentials for the NativePHP plugin repository.
composer config repositories.nativephp-plugins composer https://plugins.nativephp.com
composer config http-basic.plugins.nativephp.com your@email.com your-license-key
composer require nativephp/mobile-background-tasks
php artisan native:plugin:register nativephp/mobile-background-tasks
Compatibility
| Platform | Minimum Version |
|---|---|
| NativePHP | ^3.2.1 |
| iOS | 16.0+ |
| Android | API 26+ |
Scheduling API
Schedule::command('your:command')
->onAnyNetwork()
->whileCharging()
->whenBatteryNotLow()
->whenStorageNotLow()
->whenIdle()
->longRunning();
Trigger immediately with BackgroundTasks::runNow().