2014-10-09

On iOS 8, user permission is required for scheduling local notifications (of class UILocalNotification). Here's an Objective-C example.

To check whether you have permission:

  - (BOOL)appHasPermissionForLocalNotifications
  {
      UIUserNotificationSettings *settings = [[UIApplication sharedApplication] currentUserNotificationSettings];
      if(settings.types & (UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge)) {
          NSLog(@"Permission present: 0x%ulX", settings.types);
          return YES;
      } else {
          NSLog(@"Permission not present: 0x%ulX", settings.types);
          return NO;
      }
  }

To request permission:

  [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];