Use of undeclared type UNAuthorizationOptions

前端 未结 2 1470
遥遥无期
遥遥无期 2021-02-18 21:12

I am trying to use Firebase to handle push notifications. I have installed Firebase pod (\'Firebase/Core\' and \'FirebaseMessaging\' pods).

And after I impo

2条回答
  •  一整个雨季
    2021-02-18 21:50

    UserNotifications.framework is available from iOS 10 and you are working with Xcode 7.3 means with iOS 9 and lower, So there is no need for you to add that if #available(iOS 10.0, *) {, write only else part directly and register remote notifications.

    let settings: UIUserNotificationSettings = UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound], categories: nil)
    application.registerUserNotificationSettings(settings)
    application.registerForRemoteNotifications()
    

提交回复
热议问题