Firebase notifications not working in iOS 11
This is an issue with Firebase. It seems to be related to a recent update of theirs instead of iOS 11. They are working on a fix for it.
In the meantime if you add pod 'FirebaseInstanceID', '2.0.0'
to your podfile it will fix it.
You can read more here: https://github.com/firebase/quickstart-ios/issues/327#issuecomment-332655731
Check this in your project capability. It's helped me)
You need to implement UNUserNotificationCenterDelegate
extension AppDelegate: UNUserNotificationCenterDelegate {
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
completionHandler(.alert)
}
}
and set it to UNUserNotificationCenter
object inside didFinishLaunchingWithOptions
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
UNUserNotificationCenter.current().delegate = self
return true
}