From the version 2.0.0, RssBook support ‘Background App Refresh’. This leads to support ‘Auto Sync Anytime’, such as get synced while you’re sleeping. This is a brief guide for this feature.
Auto sync can be run in two modes. 1) Run only when app is active or 2) always enabled. Auto sync options(interval, wifi, battery) are applied same to both modes.
We call ‘always enabled auto sync’ as ‘Background Sync’. It takes advantage of ‘Background App Refresh‘ introduced in iOS 7 (Specifically ‘Background fetch’). But it was not easy to make good use of. Because background mode allows only 30 seconds to run at a time. Generally, time needed to sync exceeds it.
So, we make sync as ‘resumable’. If user press home button while syncing, app goes to paused status. When user returns, app resumes previous sync. Before supporting this resumable feature, sync will end with timeout error on return.
With the help of resumable sync, we can complete one sync out of multiple background runs. The frequency how often background mode called may vary by situation. But we expect that there will be several calls for a hour at night time when device is not used and under charging.
In fact, we use only 20 seconds for each background run(for stablility). So, it can take up to one or more hours to complete one sync. It may need your tuning to find out how long it will take. For the convenience, we add ‘background sync start time’ at ‘Last Sync Status’ detail. It will help you to calculate actual background sync time.
Tip:
Even though our app is enabled for ‘Background App Refresh’ in settings, if you close our app explicitly in ‘App Switcher‘, backgound mode will not be fired because iOS intelligently block it. So it can be a convenient method to disable background sync temporarily – until next time you launch our app.
PS:
Because RssBook supports resumable sync, following situation is possible.
- If app is moved to background(by pressing home button) while sync is in progress, that sync may complete in background mode or resume when app is re-activated.
- There’ll be a increased chance that sync is already in progress when user activate app. This is because background sync has already began but not completed.
Background sync can not be strictly time scheduled. It depends mainly on iOS system allocation. iOS system will not allow run in busy or low resource condition. And auto sync option will be only effective for blocking sync in certain criteria. So, you better to think ‘Background Sync’ as a time-saving feature rather than a strict sync scheduler. Once background sync has enabled, it will dramatically reduce your active sync time because it may already make close to up-to-date states before your using.
Like this:
Like Loading...