mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-14 17:23:25 +01:00
Fixes UIApplication.setMinimumBackgroundFetchInterval() deprecation warning
This commit is contained in:
@@ -16,6 +16,8 @@ import AltSign
|
||||
import Roxas
|
||||
import EmotionalDamage
|
||||
|
||||
extension UIApplication: LegacyBackgroundFetching {}
|
||||
|
||||
extension AppDelegate
|
||||
{
|
||||
static let openPatreonSettingsDeepLinkNotification = Notification.Name(Bundle.Info.appbundleIdentifier + ".OpenPatreonSettingsDeepLinkNotification")
|
||||
@@ -244,7 +246,7 @@ extension AppDelegate
|
||||
private func prepareForBackgroundFetch()
|
||||
{
|
||||
// "Fetch" every hour, but then refresh only those that need to be refreshed (so we don't drain the battery).
|
||||
UIApplication.shared.setMinimumBackgroundFetchInterval(1 * 60 * 60)
|
||||
(UIApplication.shared as LegacyBackgroundFetching).setMinimumBackgroundFetchInterval(1 * 60 * 60)
|
||||
|
||||
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { (success, error) in
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//
|
||||
// PeekPopPreviewing.swift
|
||||
// DeprecatedAPIs.swift
|
||||
// AltStore
|
||||
//
|
||||
// Created by Riley Testut on 3/2/23.
|
||||
@@ -8,9 +8,15 @@
|
||||
|
||||
import UIKit
|
||||
|
||||
// Conforming UIViewControllers to PeekPopPreviewing allows us to call deprecated registerForPreviewing(with:sourceView:) without warnings.
|
||||
// Conform types to these protocols to call deprecated APIs without warnings.
|
||||
|
||||
protocol PeekPopPreviewing
|
||||
{
|
||||
@discardableResult
|
||||
func registerForPreviewing(with delegate: UIViewControllerPreviewingDelegate, sourceView: UIView) -> UIViewControllerPreviewing
|
||||
}
|
||||
|
||||
protocol LegacyBackgroundFetching
|
||||
{
|
||||
func setMinimumBackgroundFetchInterval(_ minimumBackgroundFetchInterval: TimeInterval)
|
||||
}
|
||||
Reference in New Issue
Block a user