I managed to fix this crash by wrapping the init
body in a Task
:
init() {
Task {
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { (success, error) in }
}
}
The app still crashes, but at a different point, so this is 'fixed'.