The OfflineDetection Reactive component is designed to provide Mobile and Reactive apps with the ability to accurately detect whether they are online or offline, even when devices are connected to WiFi networks with no connectivity.
It can help you make your mobile apps ready for scenarios with intermittent network access and provide a rubost user experience by adapting the context to the available resources, improving OfflineData synchronization patterns or simply provide visual warnings of connection changes.
The component is based on the OfflineJS library and is composed by the OfflineDetectionEvents block and the IsOffline client action.
Block that triggers OfflineDetection events based on connection changes
When an application is required to react to connection changes.
Drag the block into a different block or screen and then create a new action handler for any of the relevant events for your use case.
The 3 warning placeholders are only displayed when the ShowWarningMessage flag is set to true, meaning the triggered events will also add visual feedback. Consider changing their content and override their CSS styles to better fit your app experience.
If you need to handle the OfflineDetection events throughout the whole application, consider placing the block in the layout itself.
The events triggered by the block are:
Checks the current state of the connection, returns true if offline.
When action flows or the user interface need to be aware of the connection status.
Call the client action within action flows to query the connection status. It can also be used as a function in expressions.
⚠️ The action requires the OfflineDetectionEvents block to be present, otherwise the OfflineJS script will not be available and the output will be true (offline) regardless of the actual state.