Local Zap Notifications
Changelog-Added: Local zap notifications
This commit is contained in:
@@ -9,6 +9,7 @@ import SwiftUI
|
||||
|
||||
@main
|
||||
struct damusApp: App {
|
||||
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
MainView()
|
||||
@@ -43,6 +44,19 @@ struct MainView: View {
|
||||
}
|
||||
}
|
||||
|
||||
class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCenterDelegate {
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
|
||||
UNUserNotificationCenter.current().delegate = self
|
||||
return true
|
||||
}
|
||||
|
||||
// Handle the notification in the foreground state
|
||||
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
|
||||
// Display the notification in the foreground
|
||||
completionHandler([.alert, .sound, .badge])
|
||||
}
|
||||
}
|
||||
|
||||
func needs_setup() -> Keypair? {
|
||||
return get_saved_keypair()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user