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.
This commit is contained in:
Joelle Stickney
2022-12-19 23:26:15 -05:00
parent 2c0b167e6b
commit c18db77ade
2 changed files with 5 additions and 5 deletions

View File

@@ -758,7 +758,7 @@ extension AppManager
extension AppManager extension AppManager
{ {
@discardableResult @discardableResult
func backgroundRefresh(_ installedApps: [InstalledApp], presentsNotifications: Bool = true, completionHandler: @escaping (Result<[String: Result<InstalledApp, Error>], Error>) -> Void) -> BackgroundRefreshAppsOperation func backgroundRefresh(_ installedApps: [InstalledApp], presentsNotifications: Bool = false, completionHandler: @escaping (Result<[String: Result<InstalledApp, Error>], Error>) -> Void) -> BackgroundRefreshAppsOperation
{ {
let backgroundRefreshAppsOperation = BackgroundRefreshAppsOperation(installedApps: installedApps) let backgroundRefreshAppsOperation = BackgroundRefreshAppsOperation(installedApps: installedApps)
backgroundRefreshAppsOperation.resultHandler = completionHandler backgroundRefreshAppsOperation.resultHandler = completionHandler

View File

@@ -56,7 +56,7 @@ class BackgroundRefreshAppsOperation: ResultOperation<[String: Result<InstalledA
let installedApps: [InstalledApp] let installedApps: [InstalledApp]
private let managedObjectContext: NSManagedObjectContext private let managedObjectContext: NSManagedObjectContext
var presentsFinishedNotification: Bool = true var presentsFinishedNotification: Bool = false
private let refreshIdentifier: String = UUID().uuidString private let refreshIdentifier: String = UUID().uuidString
private var runningApplications: Set<String> = [] private var runningApplications: Set<String> = []
@@ -189,12 +189,12 @@ private extension BackgroundRefreshAppsOperation
let content = UNMutableNotificationContent() let content = UNMutableNotificationContent()
var shouldPresentAlert = true var shouldPresentAlert = false
do do
{ {
let results = try result.get() let results = try result.get()
shouldPresentAlert = !results.isEmpty shouldPresentAlert = false
for (_, result) in results for (_, result) in results
{ {
@@ -216,7 +216,7 @@ private extension BackgroundRefreshAppsOperation
content.title = NSLocalizedString("Failed to Refresh Apps", comment: "") content.title = NSLocalizedString("Failed to Refresh Apps", comment: "")
content.body = error.localizedDescription content.body = error.localizedDescription
shouldPresentAlert = true shouldPresentAlert = false
} }
if shouldPresentAlert if shouldPresentAlert