feat(sync): add background task system for nightly CloudKit sync
Add BGTaskScheduler-based background sync for keeping local data fresh: - BackgroundSyncManager: New singleton managing background tasks - BGAppRefreshTask for periodic CloudKit sync (system-determined frequency) - BGProcessingTask for overnight sync + database cleanup (2 AM) - Auto-archives games older than 1 year during cleanup - Info.plist: Added BGTaskSchedulerPermittedIdentifiers - com.sportstime.app.refresh (periodic sync) - com.sportstime.app.db-cleanup (overnight processing) - SportsTimeApp: Integrated background task lifecycle - Register tasks in init() (required before app finishes launching) - Schedule tasks after bootstrap and when app enters background Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,5 +8,10 @@
|
||||
<string>fetch</string>
|
||||
<string>processing</string>
|
||||
</array>
|
||||
<key>BGTaskSchedulerPermittedIdentifiers</key>
|
||||
<array>
|
||||
<string>com.sportstime.app.refresh</string>
|
||||
<string>com.sportstime.app.db-cleanup</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
Reference in New Issue
Block a user