Converts legacy RefreshAllIntent into App Shortcut (iOS 17+)

This commit is contained in:
Riley Testut
2023-08-18 18:16:05 -05:00
committed by Magesh K
parent 9b885085c9
commit 7747994c80
9 changed files with 291 additions and 4 deletions

View File

@@ -117,10 +117,10 @@ final class BackgroundRefreshAppsOperation: ResultOperation<[String: Result<Inst
self.startListeningForRunningApps()
// Wait for 3 seconds (2 now, 1 later in FindServerOperation) to:
// Wait for 2 seconds (1 now, 1 later in FindServerOperation) to:
// a) give us time to discover AltServers
// b) give other processes a chance to respond to requestAppState notification
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {
self.managedObjectContext.perform {
let filteredApps = self.installedApps.filter { !self.runningApplications.contains($0.bundleIdentifier) }
@@ -152,6 +152,8 @@ final class BackgroundRefreshAppsOperation: ResultOperation<[String: Result<Inst
group.completionHandler = { (results) in
self.finish(.success(results))
}
self.progress.addChild(group.progress, withPendingUnitCount: 1)
}
}
}