我正在遵循Firebase推送通知快速入门,但收到此错误。
不确定发生了什么,因为这是快速入门指南的文档。
发布于 2016-10-29 10:09:23
您正在尝试将AppDelegate
设置为UNUserNotificationCenterDelegate
,但您的AppDelegate
尚未实现该协议。了解有关here协议的更多信息。可以在here中找到UNUserNotificationCenterDelegate
的规范。像这样的东西将会起作用:
extension AppDelegate: UNUserNotificationCenterDelegate {
optional func userNotificationCenter(_ center: UNUserNotificationCenter,
willPresent notification: UNNotification,
withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
// TODO: Implement
}
optional func userNotificationCenter(_ center: UNUserNotificationCenter,
didReceive response: UNNotificationResponse,
withCompletionHandler completionHandler: @escaping () -> Void) {
// TODO: Implement
}
}
第二个错误表示该属性不存在。文档很可能与框架一起过时了。
https://stackoverflow.com/questions/40315263
复制相似问题