Fixes UIApplication.setMinimumBackgroundFetchInterval() deprecation warning

This commit is contained in:
Riley Testut
2023-03-02 15:56:41 -06:00
committed by Magesh K
parent 8695c412d7
commit 824fc48e77
3 changed files with 15 additions and 7 deletions

View File

@@ -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
}