I know this can't work because the completion handler
is on a background Thread
but
where am I supposed do dispatch the main queue or what else do i have to do?
this is the code:
static func isNotificationNotDetermined() -> Bool{
var isNotDetermined = false
UNUserNotificationCenter.current().getNotificationSettings { (notificationSettings) in
switch notificationSettings.authorizationStatus {
case .notDetermined:
isNotDetermined = true
case .authorized:
isNotDetermined = false
case .denied:
isNotDetermined = false
}
}
return isNotDetermined
}