cancel
Showing results for 
Search instead for 
Did you mean: 

Sync automatically when online - MDK

0 Kudos

I have created an offline app in MDK. I have added a button to sync to the backend. I wanted to know if there is any way to detect, if the device is connected to a network so that it automatically sync. instead of clicking on the sync button.

Thank You

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

kohlisamvaran76

Were you able to resolve your issue? If any of the below responses helped you, then please mark the helpful answer by accepting it OR post an answer so others might benefit from your findings and then close this discussion.

Regards,
Jitendra (SAP Community Moderator)

Accepted Solutions (0)

Answers (1)

Answers (1)

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert

You can use the Connectivity module from NativeScript that we have also exposed via ClientAPI.nativescript.connectivityModule.

you can use connectivityModule.startMonitoring and connectivityModule.stopMonitoring functions that will allow you to monitor when the app is connected to certain connection, and then you can trigger the upload/download.