I'm trying to implement push notification by using Firebase. I have installed the 'Firebase/Core' and 'Firebase/Messaging' frameworks using cocapod. I'm able to import FirebaseInstanceID & FirebaseMessaging in the File. But for "import UserNotifications" it says "No Such Module". I'm using Swift 2.1.1 and Xcode 7.3.1 and my targeted iOS is 8.1+ ... Kindly Help, thanks in advance .
Upgrading to XCode 8 is probably the best option.
But if you can't or don't want to upgrade for some reason you can use old way of APN Registration (without importing UserNotifications):
let settings: UIUserNotificationSettings =
UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound], categories: nil)
application.registerUserNotificationSettings(settings)
application.registerForRemoteNotifications()
Firebase Messaging will work, but some new iOS10 features might not function.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With