Scribe-iOS
Scribe-iOS copied to clipboard
Setting up application background processes for data download
Terms
- [X] I have searched open and closed data issues
- [X] I agree to follow Scribe-iOS' Code of Conduct
Description
This issue documents native iOS settings to request user to run processes in the backgound. This would be used in fetching updates when language data is updated as well allow data to be downloaded in the background.
Issue was discuseed in a weekly meeting conducted on 27th June, 2023.
@SaurabhJamadagni is looking into the documentation to set this up. @andrewtavis could look into the implementation.
This issue is open to discussion from the community. Please feel free to share your ideas on ways to execute this š
Hey @andrewtavis, here's some documentation that might be helpful for this issue:
Doc: Using background tasks to update your app
- Tasks can be scheduled using the BGTaskScheduler object. There is a shared instance that can be used.
- There are two types of tasks -- BGAppRefreshTask and BGProcessingTask.
- BGAppRefreshTask is for short-duration tasks that expect quick results, such as downloading a stock quote.
- BGProcessingTask is for tasks that might be time-consuming, such as downloading a large file or synchronizing data.
- I think we could use BGProcessingTask to download the updated data. But then use BGAppRefreshTask to update the buttons from say
DownloadedtoUpdate Available. The strings can be as per our design files of course.
- We need to add
Background Modescapability to the necessary targets. - Tasks need an identifier and then we can add them to the Info.plist file under āPermitted background task scheduler identifiersā.
- We can then register, schedule and run tasks. I think the doc might be the best explanation for how to proceed with registering and submitting the task. We will be using the BGTaskScheduler object for registering and submitting the scheduled request.