Check if Local Notifications are enabled in IOS 8

You can check it by using UIApplication ‘s currentUserNotificationSettings

if ([[UIApplication sharedApplication] respondsToSelector:@selector(currentUserNotificationSettings)]){ // Check it's iOS 8 and above
    UIUserNotificationSettings *grantedSettings = [[UIApplication sharedApplication] currentUserNotificationSettings];

    if (grantedSettings.types == UIUserNotificationTypeNone) {
        NSLog(@"No permiossion granted");
    }
    else if (grantedSettings.types & UIUserNotificationTypeSound & UIUserNotificationTypeAlert ){
        NSLog(@"Sound and alert permissions ");
    }
    else if (grantedSettings.types  & UIUserNotificationTypeAlert){
        NSLog(@"Alert Permission Granted");
    }
}

Hope this helps , Let me know if you need more info

Leave a Comment