mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
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:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user