Thank you for contacting us.
In the above mentioned article you can also see the use cases and specific features our offline feature supports. You should also not need to rewrite your code. You can simply enable the offline storage by setting the offline
option to true
when initializing the sdk. You will also need to switch the sdk's mode to online/offline
depending on your device's connection state. You can also take a look at our Deliveries sample
which should cover most, if not all of your use cases.
Also, you can configure the caching as explained here
in order to provide the required caching capabilities for your app. This way you can configure a longer caching period or force an operation to ignore/prefer cached values. At predefined intervals or when the app becomes online you may just need to make a request that ignores the cache and reads the fresh data instead.
The latter can also be achieved by using the syncUnmodified
setting and obtaining the latest data from the server at the time of syncing the offline data.
This said, I believe that your scenario can be achieved by configuring properly the SDK options and data operations and passing them the needed settings depending of your app's state and requirements.
I hope this will help.