Skip to content

High performance self-hosted photo and video management solution.

feat: iOS dynamic background ids (#30574)

mikes1991gh3af2ba19ec88
diff --git a/mobile/ios/Runner/Background/BackgroundWorkerApiImpl.swift b/mobile/ios/Runner/Background/BackgroundWorkerApiImpl.swift
index a7bbc31ceb..0eee970e71 100644
--- a/mobile/ios/Runner/Background/BackgroundWorkerApiImpl.swift
+++ b/mobile/ios/Runner/Background/BackgroundWorkerApiImpl.swift
@@ -22,8 +22,9 @@ class BackgroundWorkerApiImpl: BackgroundWorkerFgHostApi {
print("BackgroundWorkerApiImpl:disableUploadWorker Disabled background workers")
}
- private static let refreshTaskID = "app.alextran.immich.background.refreshUpload"
- private static let processingTaskID = "app.alextran.immich.background.processingUpload"
+ private static let taskIDs = Bundle.main.object(forInfoDictionaryKey: "BGTaskSchedulerPermittedIdentifiers") as! [String]
+ private static let refreshTaskID = taskIDs.first { $0.hasSuffix(".refreshUpload") }!
+ private static let processingTaskID = taskIDs.first { $0.hasSuffix(".processingUpload") }!
private static let taskSemaphore = DispatchSemaphore(value: 1)
public static func registerBackgroundWorkers() {