I have push notifications in my app. Whenever the app is launched, I would like to check whether the user has enabled push notification for my application.
I do it this
This is the Swift 3 version where you can check whether notifications are enabled or disabled.
let notificationType = UIApplication.shared.currentUserNotificationSettings?.types if notificationType?.rawValue == 0 { print("Disabled") } else { print("Enabled") }