if #available(iOS 10.0, *) {
let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
UNUserNotificationCenter.current().requestAuthorization(
options: authOptions,
completionHandler: {_, _ in }
)
// For iOS 10 display notification (sent via APNS)
UNUserNotificationCenter.current().delegate = self
// For iOS 10 data message (sent via FCM)
FIRMessaging.messaging().remoteMessageDelegate = self //ERROR THIS LINE
}
else {
let settings: UIUserNotificationSettings = UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)
application.registerUserNotificationSettings(settings)
}
将委托设置为self时出错。“FIRMessing没有成员remoteMessageDelegate”
2条答案
按热度按时间wz3gfoph1#
试试这个:
rryofs0p2#
看来Google的文档已经过时了。
请在您的终端中运行以下命令:
然后转到您的项目文件夹并运行