offlinedetection-reactive
Reactive icon

OfflineDetection Reactive

Stable version 1.0.0 (Compatible with OutSystems 11)
Uploaded
 on 06 September 2023
 by 
5.0
 (1 rating)
offlinedetection-reactive

OfflineDetection Reactive

Documentation
1.0.0

OfflineDetection

Context

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.




OfflineDetectionEvents

Block that triggers OfflineDetection events based on connection changes

When to use

When an application is required to react to connection changes.

How to use

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:

  • Checking: Whenever we are testing the connection
  • ConfirmedOffline: A connection test has failed, fired even if the connection was already offline
  • ConfirmedOnline: A connection test has succeeded, fired even if the connection was already online
  • Offline: The connection has gone from online to offline
  • Online: The connection has gone from offline to online
  • Checking: Whenever we are testing the connection
  • RequestsCapture: A new request is being held (if RemakeRequests flag is set to true)
  • RequestsFlush: Any pending requests have been remade (if RemakeRequests flag is set to true)




IsOffline

Checks the current state of the connection, returns true if offline.

When to use

When action flows or the user interface need to be aware of the connection status.

How to use

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.




External Libraries Licenses