Does TriggerOfflineDataSync rely on GetNetworkStatus? 

Does TriggerOfflineDataSync rely on GetNetworkStatus? 

  

Hi,

I have a question - does TriggerOfflineDataSync rely on GetNetworkStatus function? For example if I'm connected to local wifi without internet the data tries to sync anyway an that triggers a timeout error. Should I add custom "internet connection check" on TriggerOfflineDataSync like using offline.js for example?


Thank you

Hi Mykola,

The TriggerOfflioneDataSync action doesn't check for internet connectivity. It just triggers the OfflineDataSync action in background independently of having network or not.

If you need to check for internet connection, you can add that custom check to the OfflineDataSync action, using any 3rd party library such as offline.js.

Tell us if it worked!

Thanks!

That seems to work for me, thanks Ricardo! 

Matt Gates wrote:

That seems to work for me, thanks Ricardo! 

Good to know, hope it works for Mykola too!   


Hi Ricardo,

OfflineDataSync is running in background but when i'm not connected to any network it doesn't try to connect to server so no timeout an connection errors. So what i actually need is to trigger OfflineDataSync as usual but be sure that it try to sync only when internet connection is available. Where should I add offline.js check in this case?


Thank you

Hi Mykola,

You should add the offline.js check inside the OfflineDataSync action.

What you said is true, upon a synchronization OutSystems detects if the device is connected to a network and if it is not we skip execution of OffineDataSync. 

Adding the offline.js check inside the OfflineDataSync action, will double check if internet connection is available and, if so, do the synchronization.

Thanks!