From c18db77adee8ccfffd1d4668161e01db32b623b7 Mon Sep 17 00:00:00 2001 From: Joelle Stickney Date: Mon, 19 Dec 2022 23:26:15 -0500 Subject: [PATCH] Turn off all background refresh notifications This removes all background refresh notifications but keeps the "Reminder to open SideStore every so often", and the "x app expires soon" local push notifications. --- AltStore/Managing Apps/AppManager.swift | 2 +- AltStore/Operations/BackgroundRefreshAppsOperation.swift | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/AltStore/Managing Apps/AppManager.swift b/AltStore/Managing Apps/AppManager.swift index 8bc9a16c..00958353 100644 --- a/AltStore/Managing Apps/AppManager.swift +++ b/AltStore/Managing Apps/AppManager.swift @@ -758,7 +758,7 @@ extension AppManager extension AppManager { @discardableResult - func backgroundRefresh(_ installedApps: [InstalledApp], presentsNotifications: Bool = true, completionHandler: @escaping (Result<[String: Result], Error>) -> Void) -> BackgroundRefreshAppsOperation + func backgroundRefresh(_ installedApps: [InstalledApp], presentsNotifications: Bool = false, completionHandler: @escaping (Result<[String: Result], Error>) -> Void) -> BackgroundRefreshAppsOperation { let backgroundRefreshAppsOperation = BackgroundRefreshAppsOperation(installedApps: installedApps) backgroundRefreshAppsOperation.resultHandler = completionHandler diff --git a/AltStore/Operations/BackgroundRefreshAppsOperation.swift b/AltStore/Operations/BackgroundRefreshAppsOperation.swift index d830979f..3d0fd6a4 100644 --- a/AltStore/Operations/BackgroundRefreshAppsOperation.swift +++ b/AltStore/Operations/BackgroundRefreshAppsOperation.swift @@ -56,7 +56,7 @@ class BackgroundRefreshAppsOperation: ResultOperation<[String: Result = [] @@ -189,12 +189,12 @@ private extension BackgroundRefreshAppsOperation let content = UNMutableNotificationContent() - var shouldPresentAlert = true + var shouldPresentAlert = false do { let results = try result.get() - shouldPresentAlert = !results.isEmpty + shouldPresentAlert = false for (_, result) in results { @@ -216,7 +216,7 @@ private extension BackgroundRefreshAppsOperation content.title = NSLocalizedString("Failed to Refresh Apps", comment: "") content.body = error.localizedDescription - shouldPresentAlert = true + shouldPresentAlert = false } if shouldPresentAlert