Device Registration for APN not working on iOS 14

Hi there,
since iOS 14 I have the problem that when I try to request the authorization for push notifications I instant get an error message which says "Notifications are not allowed for this application". On older iOS versions everything is working fine but since iOS 14 there is something wrong. Have you any idea?

In my app delegate i run the following code:

Code Block
let center = UNUserNotificationCenter.current()        
center.requestAuthorization(options: [.alert, .sound, .badge]) { granted, error in
if granted {
UIApplication.shared.registerForRemoteNotifications()
}
if let error = error {
printLogs(error, logLevel: .ERROR)
return
}
}

When running this code i instant get an error in the completion without displaying any alert to the user

Replies

This issue is also being discussed in another thread. Please read the answer here for an explanation and a workaround: https://developer.apple.com/forums/thread/660715?answerId=635041022#635041022