Scribe-iOS icon indicating copy to clipboard operation
Scribe-iOS copied to clipboard

Setting up application background processes for data download

Open SaurabhJamadagni opened this issue 2 years ago • 1 comments

Terms

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 😊

SaurabhJamadagni avatar Jul 01 '23 06:07 SaurabhJamadagni

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 Downloaded to Update Available. The strings can be as per our design files of course.
  • We need to add Background Modes capability 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.

SaurabhJamadagni avatar Jul 16 '23 07:07 SaurabhJamadagni