RaPla parser is now aware of recurring events

- Also some small improvements and basic implementation of Notifications
This commit is contained in:
2021-04-07 13:26:37 +02:00
committed by Patrick Müller
parent 805495fb81
commit 02cd3a0db9
10 changed files with 359 additions and 56 deletions
+21 -1
View File
@@ -6,12 +6,14 @@
//
import SwiftUI
import UserNotifications
@main
struct DHBW_ServiceApp: App {
@UIApplicationDelegateAdaptor private var appDelegate: AppDelegate
let persistenceController = PersistenceController.shared
let settings = LocalSettings()
var body: some Scene {
WindowGroup {
ContentView()
@@ -20,3 +22,21 @@ struct DHBW_ServiceApp: App {
}
}
}
//*** Implement App delegate ***//
class AppDelegate: NSObject, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
return true
}
//No callback in simulator
//-- must use device to get valid push token
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let tokenParts = deviceToken.map { data in String(format: "%02.2hhx", data) }
let token = tokenParts.joined()
print("Device Token: \(token)")
}
func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
print(error.localizedDescription)
}
}