Hi when setting the language to iOS 6 my app crashes on this piece of code:
func registerForPushNotifications() {
UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { granted, error in
print("Permission granted: \(granted)")
guard granted else { return }
self.getNotificationSettings()
}
}
It has to do with the requestAuthorization When I restart the app it crashes immediately. This is because I had already made a choice for this.
When I change the language back to swift 5 it works fine again. Removing the self.getNotifcationSettings has nothing to do with it.
Also tried to add @MainActor to the function.
This is the tread where it crashes on: Thread 7 Queue : com.apple.usernotifications.UNUserNotificationServiceConnection.call-out (serial)
Does anybody have a idea how to fix this?