Offline Mode Handling
Goal
Detect internet connectivity changes and switch between online/offline flows.
Actions used
NetworkServicesStartNotifierNetworkServicesGetStatus(optional initial poll)NetworkServicesOnInternetConnectivityChanged(persistent listener)
Variables
isInternetActive(Bool)
Flow
On app launch: call
NetworkServicesStartNotifier.Optional: call
NetworkServicesGetStatusand branch usingisInternetActiveto initialize UI.Keep
NetworkServicesOnInternetConnectivityChangedin an active state:eventConnectedβ resume online features / sync queued actionseventDisconnectedβ pause online features / show offline UI
Notes
Listener actions should stay active; they fire events when connectivity changes.
Last updated
Was this helpful?