cancel
Showing results for 
Search instead for 
Did you mean: 

Push the data from Offline Store automatically to SAP Backend when MDK app is not open

karanshaheri
Participant
0 Kudos

Hello All,

We are in process of building a MDK offline application. Initially, when device is not having any connectivity, data will reside in the offline store. Now user may kill the app or close the app as they don't have the connectivity.

Once device detects the network, our client wants us to automatically push the data from the offline store to the backend but without any intervention of the user to even open the application. Requirement is to sync the offline store even when the app is not opened by the user. Is this possible because I couldn't find anything in the documentation regarding sending data when app is not open.

We have already tried "onSuspend" event and used connectivityModule to detect the device connectivity status before pushing the data but it doesn't work for us.

Request if anyone has cme across such a requirement.

Regards,

Karan Shaheri.

Accepted Solutions (0)

Answers (1)

Answers (1)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

No, if the app is not open there would be no way for this to happen without user interaction.

karanshaheri
Participant
0 Kudos

Hi Bill,

Thanks for the information.

Does that mean that when we close the application, app doesn't run in the background? We thought there would be some event which may help us in this requirement if the app runs in background?

How does push notifications work in MDK then?

Regards,

Karan Shaheri.

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

Correct, the app "may" continue to run for a brief time in the background but the OS controls how long and if it is allowed. For example on Android the power settings will typically disable background apps.

In general, mobile apps are highly discouraged from running in the background. We do not currently have any specific events / support for background operations especially if the app has been closed.

Push messages are actually received by the OS and not directly by the MDK client. The OS decides what to do with the push message depending on if the client is currently running or not.