I am trying to implement the application:didRegisterUserNotificationSettings:
App Delegate method to try and identify if i am allowed to send local notifications to the user in iOS 8. The following is the kind of thing i'm trying to achieve, but this is obviously the incorrect way of going about it.
- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings
{
if (notificationSettings.types /*How do i check which types are contained */) {
NSLog(@"Allowed");
} else {
NSLog(@"Not Allowed");
}
}
Here you go
if (notificationSettings.types == UIUserNotificationTypeNone) {
NSlog(@"Permission not Granted by user");
}
else{
NSlog(@"Permission Granted");
}
To interrogate a specific setting:
BOOL allowsSound = (notifSettings.types & UIUserNotificationTypeSound) != 0;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With