Interactive notification not showing ios 9.2 buttons

I believe that I am creating the interactive notifications correctly, but I am getting notifications about the spring / screen lock buttons. What am I doing wrong?

AppDelegate:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { let notificationSettings: UIUserNotificationSettings! = UIApplication.sharedApplication().currentUserNotificationSettings() /// don't want to constantly set/re-set when this function fires if (notificationSettings.types == UIUserNotificationType.None){ let yesAction = UIMutableUserNotificationAction() yesAction.identifier = "yesAction" yesAction.title = "Yes" yesAction.destructive = false yesAction.authenticationRequired = false yesAction.activationMode = UIUserNotificationActivationMode.Background let noAction = UIMutableUserNotificationAction() noAction.identifier = "noAction" noAction.title = "No" noAction.destructive = false noAction.authenticationRequired = false noAction.activationMode = UIUserNotificationActivationMode.Background let stopAction = UIMutableUserNotificationAction() stopAction.identifier = "stopAction" stopAction.title = "Stop" stopAction.destructive = true stopAction.authenticationRequired = false stopAction.activationMode = UIUserNotificationActivationMode.Background let encouragementCategory = UIMutableUserNotificationCategory() encouragementCategory.identifier = "GOCEncouragement" encouragementCategory.setActions([yesAction, noAction, stopAction], forContext: UIUserNotificationActionContext.Default) encouragementCategory.setActions([yesAction, noAction], forContext: UIUserNotificationActionContext.Minimal) let settings = UIUserNotificationSettings(forTypes: [.Alert, .Sound], categories: Set.init(arrayLiteral: encouragementCategory)) UIApplication.sharedApplication().registerUserNotificationSettings(settings) } return true } 

Somewhere else, called application(application: UIApplication, didRegisterUserNotificationSettings notificationSettings: UIUserNotificationSettings) :

 notificationArray.forEach({ let notification = UILocalNotification.init() notification.fireDate = fireDay notification.soundName = UILocalNotificationDefaultSoundName notification.alertBody = $0["Encouragement"] as! String! notification.repeatInterval = .Month notification.category = "GOCEncouragement" notification.userInfo = [ "UUID" : $0["UUID"] as! Int] if #available(iOS 8.2, *) { notification.alertTitle = "Choices Encouragement" } UIApplication.sharedApplication().scheduleLocalNotification(notification) nextDay.day++ fireDay = NSCalendar.currentCalendar().dateByAddingComponents(nextDay, toDate: fireDay!, options: NSCalendarOptions.init(rawValue: 0)) }) 

Repeated iteration of the problem; notifications are displayed according to the schedule, but the screen with the left slide on the lock does not display any buttons and does not come off on the main screen.

Any suggestions are welcome!

Edit: thought it was only a simulator, but also found on live 9.2 devices. Other versions of iOS work as expected.

+6
source share

All Articles