POS Offline Detection

Point of Sale monitors the device network connection to determine connectivity status.

Device Not Connected to Cellular / Wi-Fi

We use a Swift wrapper on top of Apple’s Network Reachability Application Sample.

Per Apple's developer documentation:

"The Reachability sample application demonstrates how to use the System Configuration framework to monitor the network state of an iOS device. It shows how to know when IP can be routed and when traffic will be routed through a Wireless Wide Area Network (WWAN) interface like EDGE or 3G.

Reachability doesn't tell your application if you can connect to a specific host. It only tells you if there's an interface that ‌allows a connection, and if that interface is the WWAN. To understand when and how to use Reachability, read Networking Overview."

What this means for Point of Sale: Our library can only tell that we can‌ reach the network (it'll be false if we're absolutely disconnected from WiFi/Cellular), but not necessarily if we can’t establish the network connection.

Device Connected to Network and Not Able to Reach the Host

When the device is connected but can't establish a network connection to the host, the app's request times out after 120 seconds, as determined by the POS app. The associated ErrorCode is 1001, and the corresponding ErrorDescription is "The request timed out."

Waiting for 120 seconds is a considerable delay for the user. To mitigate this, we've implemented a monitoring service that pings the health-check endpoint (/search/healthcheck) after 10 seconds of no response for any API calls initiated from the app to our server. Notably, this service excludes analytics and reporting-based APIs, as they are expected to require longer processing times. The timeout for a health check network call is set to 15 seconds. This is different from the 120 seconds usually set for all other network calls. Three successive health check failures triggers switching to Offline.