See Also: UIUserNotificationSettings Members
Starting with iOS 8, users must give explicit permission for apps that wish to respond to local notifications.
Prior to attempting to send local notifications, devs must request permission from the application user to manipulate the app icon badge, play a sound, or display an alert (see MonoTouch.UIKit.UIUserNotificationType). Typically, this is done in the UIAppDelegate.FinishedLaunching overridden method:
F# Example
UIUserNotificationSettings.GetSettingsForTypes( UIUserNotificationType.Alert ||| UIUserNotificationType.Badge ||| UIUserNotificationType.Sound, new NSSet()) |> UIApplication.SharedApplication.RegisterUserNotificationSettings
C# Example
var settings = UIUserNotificationSettings.GetSettingsForTypes( UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, new NSSet()); UIApplication.SharedApplication.RegisterUserNotificationSettings(settings);
The user is presented with a permissions dialog. Once they have made their choices, the system calls UIAppDelegate.DidRegisterUserNotificationSettings.
The current permissions can be read with UIApplication.CurrentUserNotificationSettings.