I recently upgraded one of my test iphones to iOS 8 and then upgraded the PUSH registration code as below (using xCode 6)
-(BOOL)hasNotificationsEnabled {
I tried to get the type information of the settings object and found out that the types property is basically a bitmask. Here is how you can extract the informations.
My example is in Swift and >= iOS 8.0 though.
let settings = UIApplication.sharedApplication().currentUserNotificationSettings()
if settings.types.rawValue & UIUserNotificationType.Alert.rawValue == UIUserNotificationType.Alert.rawValue
{
// can receive alert!
}
else
{
// if the user is not even able to receive alerts, show him a hint on how to reenable notifications in system settings
}
if settings.types.rawValue & UIUserNotificationType.Badge.rawValue == UIUserNotificationType.Badge.rawValue
{
// can receive badge!
}
if settings.types.rawValue & UIUserNotificationType.Sound.rawValue == UIUserNotificationType.Sound.rawValue
{
// can receive sound!
}