We are building an App that collects Products from an online database. During setup of the App the initial products data set is loaded and saved into the SwiftData Database.
Over time the product information will change in the online environment and we need to update this information accordingly in the App.
The idea is that based on the product update date (timestamp) we will collect all the products that have been updated since the last create/update sync.
Because it can be a large amount of products that need to be updated we would like to execute this update task in the background preferably during the night when the App/Device is not used.
We found the following from Apple and tried to implement this, https://developer.apple.com/wwdc22/10142
We would like to use this SwiftUI background tasks feature to accommodate this but are running in some questions:
- Would the Backgroundtasks be the right approach to implement this feature?
- Can we trust that this update will be executed on the defined schedule
- Can we trust that this update will be completed once started?