I am trying to use Firebase to handle push notifications. I have installed Firebase
pod (\'Firebase/Core\' and \'FirebaseMessaging\' pods).
And after I impo
you need to import UserNotifications
before calling those framework. And what Nirav D said is true, it is a new framework in iOS 10, should also remember to select the correct deployment target.
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()