work around widgets ... not sure if they work
This commit is contained in:
@@ -12,21 +12,15 @@ import WidgetKit
|
||||
|
||||
// AppDelegate.swift
|
||||
class AppDelegate: NSObject, UIApplicationDelegate {
|
||||
|
||||
|
||||
|
||||
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
|
||||
// PersistenceController.shared.clearDB()
|
||||
NotificationCenter.default.addObserver(self,
|
||||
selector: #selector(fetchChanges),
|
||||
name: .NSPersistentStoreRemoteChange,
|
||||
object: PersistenceController.shared.container.persistentStoreCoordinator)
|
||||
|
||||
application.registerForRemoteNotifications()
|
||||
UNUserNotificationCenter.current().delegate = self
|
||||
return true
|
||||
}
|
||||
|
||||
@objc func fetchChanges(note: Notification) {
|
||||
WidgetCenter.shared.reloadAllTimelines()
|
||||
}
|
||||
}
|
||||
|
||||
extension AppDelegate: UNUserNotificationCenterDelegate {
|
||||
|
||||
Reference in New Issue
Block a user