NativePHP

Overview

See how tether/nativephp-client adds automatic offline sync triggers for NativePHP mobile apps on app resume, network restore, and background tasks.

tether/nativephp-client is a commercial add-on that extends tether/client with NativePHP mobile offline sync triggers, app lifecycle awareness, connectivity awareness, and optional background scheduling.

It gives NativePHP apps sensible automatic sync triggers without asking you to wire them by hand.


What it provides

Without tether/nativephp-client, you manage sync manually: calling TetherClient::sync() from an Artisan command, a scheduled task, or in response to user action. That is enough for many desktop and server-side PHP contexts.

Mobile apps have a different rhythm. Users may open the app after days offline, connection quality changes often, and background work is limited. Your PHP application should be able to respond to those situations without caring about the platform details behind them.

tether/nativephp-client handles the common mobile sync triggers:

  • Sync on app resume - dispatches PushJob when the user opens the app again, with a configurable cooldown.
  • Sync on connectivity restored - dispatches PushJob once the device is back online.
  • Background sync - optionally schedules the full tether:sync command through nativephp/mobile-background-tasks.

PHP events

The package exposes two Laravel events that you can subscribe to if your app needs custom behaviour:

EventWhen fired
AppResumedApp becomes active again
NetworkStatusChangedDevice network connectivity changes

The built-in sync listeners are registered automatically. You only need to listen to these events for application-specific behaviour, such as updating an offline indicator or refreshing local UI state.


Requirements

  • tether/client (installed automatically as a dependency)
  • NativePHP Mobile v3+
  • PHP 8.3+, Laravel 12 or 13
  • For background sync: nativephp/mobile-background-tasks (optional)

Licensing

tether/nativephp-client is a commercial package distributed through your Tether account. See the Add-ons page for details, or open My account to manage access and Composer credentials.