UNUserNotificationCenter did receive response with completion handler is never called iOS10, swift 2.3

后端 未结 9 1200
春和景丽
春和景丽 2020-12-13 00:03

I am scheduling new notifications in iOS10, like this:

func scheduleNotification (event : Meeting, todaysBadgeCounter: Int) {

    if #available(iOS 10.0, *)         


        
9条回答
  •  失恋的感觉
    2020-12-13 00:47

    You are using incorrect function signatures

    The correct function signatures in swift are:

    func userNotificationCenter(UNUserNotificationCenter, willPresent: UNNotification, withCompletionHandler: (UNNotificationPresentationOptions) -> Void) {
    
    //your code here
    
    }
    

    and

    func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: (UNNotificationPresentationOptions) -> Void) {
    
    //your code here
    
    }
    

提交回复
热议问题