I have an app that already requested user permission for notifications before with the following 3 options:
- UNAuthorizationOptionBadge
- UNAuthorizationOptionSound
- UNAuthorizationOptionAlert
Now I want to push an update for the app that requests one more option for the same permission which is UNAuthorizationOptionCriticalAlert
I'm using this code:-
UNAuthorizationOptions options = ( UNAuthorizationOptionBadge | UNAuthorizationOptionSound | UNAuthorizationOptionAlert | UNAuthorizationOptionCriticalAlert);
[[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions:options completionHandler:^(BOOL granted, NSError *_Nullable error) {
if (!granted) {
NSLog(@"Something To Print3");
return;
}
}];
However the OS doesn't ask the user for the new option because it thinks that this permission has already been granted before. granted in the above example is already true. I tried removing the 3 old permissions but I get the same result.
How can I make the OS request the new option UNAuthorizationOptionCriticalAlert
?