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

后端 未结 9 1227
春和景丽
春和景丽 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:48

    According to the UNUserNotificationCenterDelegate docs:

    Important

    You must assign your delegate object to the UNUserNotificationCenter object no later before your app finishes launching. For example, in an iOS app, you must assign it in the applicationWillFinishLaunching(:) or applicationDidFinishLaunching(:) method.

    So, it could be an issue of setting the Notification Centre delegate too late.

提交回复
热议问题