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 way :
let notificationType = UIApplication.sharedApplication().currentUserNotificationSettings()!.types
if notificationType == UIUserNotificationType.None {
print("OFF")
} else {
print("ON")
}
If push notifications are disabled by the user, is there any way to activate this from my app?
Or is there any alternative to send user to the push notification settings (Settings - Notifications - AppName)?