Configuration
Configure NativePHP mobile offline sync behaviour for app resume, connectivity restore, background scheduling, cooldowns, network constraints, and long-running background tasks.
Publish the config file with:
php artisan vendor:publish --tag=tether-nativephp-config
This creates config/tether-nativephp.php in your application.
auto_sync_on_resume
'auto_sync_on_resume' => env('TETHER_NATIVE_AUTO_SYNC_ON_RESUME', true),
When true, a PushJob is dispatched whenever the app becomes active again. Combine it with resume_cooldown to avoid redundant syncs on rapid app switching.
resume_cooldown
'resume_cooldown' => (int) env('TETHER_NATIVE_RESUME_COOLDOWN', 30),
Minimum number of seconds that must pass since the last resume-triggered sync before another one is dispatched.
auto_sync_on_connectivity
'auto_sync_on_connectivity' => env('TETHER_NATIVE_AUTO_SYNC_ON_CONNECTIVITY', true),
When true, a PushJob is dispatched when network access becomes available. No sync is dispatched when the device goes offline.
background_sync
'background_sync' => env('TETHER_NATIVE_BACKGROUND_SYNC', false),
When true, schedules tether:sync through nativephp/mobile-background-tasks. If that package is not installed, Tether logs a warning and skips background sync registration.
background_interval
'background_interval' => env('TETHER_NATIVE_BACKGROUND_INTERVAL', 60),
Interval in minutes between background sync executions. Only applies when background_sync = true.
background_network
'background_network' => env('TETHER_NATIVE_BACKGROUND_NETWORK', 'any'),
Network constraint for background sync. Accepted values:
| Value | Meaning |
|---|---|
any | Run on WiFi or cellular (default) |
wifi | Only run when WiFi is available |
background_long_running
'background_long_running' => env('TETHER_NATIVE_BACKGROUND_LONG_RUNNING', false),
When true, asks nativephp/mobile-background-tasks to give the sync command more execution time when that capability is available.