0

I have an app that already requested user permission for notifications before with the following 3 options:

  • UNAuthorizationOptionBadge
  • UNAuthorizationOptionSound
  • UNAuthorizationOptionAlert

notification permission

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?

  • If permissions have already been requested then you will need to display an alert yourself that request the user to go in to your app's settings and enable the additional permission – Paulw11 Jul 05 '19 at 21:14
  • The permission has been requested and granted before but I want to add a new option to the permission. No other way than directing the users to settings? – Ahmed El Melegy Jul 05 '19 at 23:29
  • 1
    Nope. Once the permissions request has been shown by iOS and the user has responded, iOS won't show it again, even if you are asking for additional options – Paulw11 Jul 05 '19 at 23:30

0 Answers0