5bc81d5b3b
iOS SwiftUI app with Supabase auth/realtime, Node.js backend, Docker/Supabase self-hosted infrastructure, and APNs scheduler. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
17 lines
435 B
Swift
17 lines
435 B
Swift
import UserNotifications
|
|
import UIKit
|
|
|
|
final class NotificationService {
|
|
static let shared = NotificationService()
|
|
|
|
func requestPermission() async -> Bool {
|
|
(try? await UNUserNotificationCenter.current()
|
|
.requestAuthorization(options: [.alert, .sound, .badge])) ?? false
|
|
}
|
|
|
|
@MainActor
|
|
func registerForRemoteNotifications() {
|
|
UIApplication.shared.registerForRemoteNotifications()
|
|
}
|
|
}
|