Add background task for overnight widget data refresh

- Create BackgroundTaskManager that schedules refresh at random time
  between 12:00 AM - 4:00 AM local time
- Fetches tasks from API, writes to DataManager and shared App Group
- Reloads widget timelines after refresh
- Register task in AppDelegate, schedule when app goes to background
- Add BGTaskSchedulerPermittedIdentifiers and fetch/processing modes to Info.plist

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-12-23 20:36:17 -06:00
parent 4daaa1f7d8
commit 556b187508
5 changed files with 256 additions and 41 deletions

View File

@@ -675,6 +675,8 @@
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = iosApp/Info.plist;
INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO;
INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace = NO;
INFOPLIST_KEY_NSCameraUsageDescription = "Casera needs access to your camera to take photos of completed tasks";
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "Casera needs access to your photo library to select photos of completed tasks";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
@@ -1124,6 +1126,8 @@
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = iosApp/Info.plist;
INFOPLIST_KEY_ITSAppUsesNonExemptEncryption = NO;
INFOPLIST_KEY_LSSupportsOpeningDocumentsInPlace = NO;
INFOPLIST_KEY_NSCameraUsageDescription = "Casera needs access to your camera to take photos of completed tasks";
INFOPLIST_KEY_NSPhotoLibraryUsageDescription = "Casera needs access to your photo library to select photos of completed tasks";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;