mirror of
https://github.com/Mueller-Patrick/DHBW-Service-App.git
synced 2026-04-28 18:30:09 +00:00
✨ RaPla parser is now aware of recurring events
- Also some small improvements and basic implementation of Notifications
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user