ForMobile apps, websockets are closed (and cannot autoreconnect) may control the behavior of websocket connections in unpredictable ways when thean app is "backgrounded," e.g. i.e. when the user dismisses the app or pulls up the lock screen.when the user locks the screen or switches to a different app.
Because we cannot be sure how the OS will control the websocket in this condition, Webapp does not have this issuewe should handle the connection and this event at the app level.
Add special handling for the app case so that we properly manage the websocket connection through this event.Because some low-level websocket handling is required to accomplish this, we wrap an effective practical solution in convenient public methods, tested in `chronik-client`.
These methods are implemented in Cashtab