Correctly handles RefreshAllIntent exceeding time limit

• Responds with “inProgress” status if exceeding time limit
• Displays native AltStore notification only if time limit is exceeded
This commit is contained in:
Riley Testut
2021-10-04 16:27:00 -07:00
parent d5563aafba
commit c3ca4fa8f3
2 changed files with 34 additions and 6 deletions

View File

@@ -645,12 +645,15 @@ extension AppManager
extension AppManager
{
func backgroundRefresh(_ installedApps: [InstalledApp], presentsNotifications: Bool = true, completionHandler: @escaping (Result<[String: Result<InstalledApp, Error>], Error>) -> Void)
@discardableResult
func backgroundRefresh(_ installedApps: [InstalledApp], presentsNotifications: Bool = true, completionHandler: @escaping (Result<[String: Result<InstalledApp, Error>], Error>) -> Void) -> BackgroundRefreshAppsOperation
{
let backgroundRefreshAppsOperation = BackgroundRefreshAppsOperation(installedApps: installedApps)
backgroundRefreshAppsOperation.resultHandler = completionHandler
backgroundRefreshAppsOperation.presentsFinishedNotification = presentsNotifications
self.run([backgroundRefreshAppsOperation], context: nil)
return backgroundRefreshAppsOperation
}
}