[OutSystems UI] Network status detection

Forge Component
(91)
Published on 25 Aug by OutSystems R&D
91 votes
Published on 25 Aug by OutSystems R&D

Hi,

Why is the OutSystems UI client action GetNetworkStatus using the html5 navigator.connection.type rather than navigator.online?

navigator.connection.type is according to https://caniuse.com/#search=navigator.connection not available for ios. https://developer.mozilla.org/en-US/docs/Web/API/Navigator/connection mentions also that this is experimental technology.

navigator.online on the other hand is generally available https://caniuse.com/#search=navigator.online, and not experimental https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine/onLine.


Daniël Kuhlmann wrote:

Hi,

Why is the OutSystems UI client action GetNetworkStatus using the html5 navigator.connection.type rather than navigator.online?

navigator.connection.type is according to https://caniuse.com/#search=navigator.connection not available for ios. https://developer.mozilla.org/en-US/docs/Web/API/Navigator/connection mentions also that this is experimental technology.

navigator.online on the other hand is generally available https://caniuse.com/#search=navigator.online, and not experimental https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine/onLine.


Hi,


I think is because one is more old than other? And about IOS devices, they adapt any systems, so they guarantee the device with IOS works too.


Daniël Kuhlmann wrote:

Hi,

Why is the OutSystems UI client action GetNetworkStatus using the html5 navigator.connection.type rather than navigator.online?

navigator.connection.type is according to https://caniuse.com/#search=navigator.connection not available for ios. https://developer.mozilla.org/en-US/docs/Web/API/Navigator/connection mentions also that this is experimental technology.

navigator.online on the other hand is generally available https://caniuse.com/#search=navigator.online, and not experimental https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine/onLine.


Hi,


Is that a reason that GetNetworkStatus client action does not check whether there is actually an internet connection?


Kind Regards,

Sylber


Solution

Hi Sylber,

I checked the implementation of the GetNetworkStatus, and since I posted my question this has already been changed/fixed:

Regards,

Daniel

Solution

Daniël Kuhlmann wrote:

Hi Sylber,

I checked the implementation of the GetNetworkStatus, and since I posted my question this has already been changed/fixed:

Regards,

Daniel

Hi Daniel,


Thanks for the quick response! According the notes in https://caniuse.com/#search=navigator.online,  it says the following: - "online" does not always mean connection to the internet, it can also just mean connection to some network.-


So we shouldn't actually use this to check if their mobile application is connected to the internet... Because in the Javascript of GetNetworkStatus client action the following is commented:" Uses navigator to check if device is online".


Regards,

Sylber


Hi Sylber,

For better offline detection and handling, have a look at 

https://www.outsystems.com/forge/component-overview/3303/offlinedetection

Regards,

Daniel