0

I am trying to get active local notification alert style for app in settings.

I got following code to get it but it's not working for local notification.

UIRemoteNotificationType types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];

I just need to know which kind of alert type is set by user in settings i.e. None, Banners, Alerts...

Or

I am getting alert for local notification when alert style is set to Alerts in Settings for app. But I am not getting click event for this any of those button.

I need to take decision based upon click event of button or Active local notification alert style. If I can get click event of that button or active notification alert style for app then it would be very helpful for me.

Thanks for your help in advance!!!

Jayeshkumar Sojitra
  • 2,501
  • 4
  • 31
  • 44

1 Answers1

1
UIRemoteNotificationType types = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];

Now you can just check

if (types & UIRemoteNotificationTypeAlert)

Will return YES if "Alert Style" is set to "Banners" or "Alerts",

and NO if "Alert Style" is set to "None".

iBhavin
  • 1,261
  • 15
  • 30