firebase / quickstart-ios

Firebase Quickstart Samples for iOS
https://firebase.google.com
Apache License 2.0
2.8k stars 1.47k forks source link

FCM Push notifications do not work on iOS 11 #327

Closed alexanderkhitev closed 7 years ago

alexanderkhitev commented 7 years ago

I use Firebase as a backend. I also use FCM as one of the provided features from Firebase. FCM worked well in iOS 10, but after switching to iOS 11, push notifications stopped coming to user devices, and I myself did not receive any push notifications sent from the cloud functions or the Notification section in the Firebase Console. How to fix this problem?

Update: I sent several push notifications from Firebase Notifcations, but they do not come.

// MARK: - Push notification

extension AppDelegate: UNUserNotificationCenterDelegate {

    func registerPushNotification(_ application: UIApplication) {
        // For iOS 10 display notification (sent via APNS)
        UNUserNotificationCenter.current().delegate = self

        let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
        UNUserNotificationCenter.current().requestAuthorization(
            options: authOptions,
            completionHandler: {_, _ in })

        // For iOS 10 data message (sent via FCM)
        Messaging.messaging().delegate = self
    }

    func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
        //When the notifications of this code worked well, there was not yet.
        Messaging.messaging().apnsToken = deviceToken
    }

    // [START receive_message]
    func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any]) {
        // If you are receiving a notification message while your app is in the background,
        // this callback will not be fired till the user taps on the notification launching the application.
        // TODO: Handle data of notification
        // Print message ID.
        if let messageID = userInfo[gcmMessageIDKey] {
            debugPrint("Message ID: \(messageID)")
        }

        // Print full message.
        debugPrint(userInfo)
    }

    func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any],
                     fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
        // If you are receiving a notification message while your app is in the background,
        // this callback will not be fired till the user taps on the notification launching the application.
        // TODO: Handle data of notification
        // Print message ID.
        if let messageID = userInfo[gcmMessageIDKey] {
            print("Message ID: \(messageID)")
        }

        // Print full message.
        debugPrint(userInfo)

        completionHandler(.newData)
    }

    // showing push notification

    func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
        if let userInfo = response.notification.request.content.userInfo as? [String : Any] {
            let routerManager = RouterManager()
            routerManager.launchRouting(userInfo)
        }
        completionHandler()
    }

    func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
        if let userInfo = notification.request.content.userInfo as? [String : Any] {
            if let categoryID = userInfo["categoryID"] as? String {
                if categoryID == RouterManager.Categories.newMessage.id {
                    if let currentConversation = ChatGeneralManager.shared.currentChatPersonalConversation, let dataID = userInfo["dataID"] as? String  {
                        // dataID is conversationd id for newMessage
                        if currentConversation.id == dataID {
                            completionHandler([])
                            return
                        }
                    }
                }
            }
            if let badge = notification.request.content.badge {
                AppBadgesManager.shared.pushNotificationHandler(userInfo, pushNotificationBadgeNumber: badge.intValue)
            }
        }
        completionHandler([.alert,.sound, .badge])
    }

}

// [START ios_10_data_message_handling]
extension AppDelegate : MessagingDelegate {

    func messaging(_ messaging: Messaging, didRefreshRegistrationToken fcmToken: String) {
        let pushNotificationManager = PushNotificationManager()
        pushNotificationManager.saveNotificationTokenInDatabase(token: fcmToken, success: nil, fail: nil)
    }

    // Receive data message on iOS 10 devices while app is in the foreground.
    func application(received remoteMessage: MessagingRemoteMessage) {
        debugPrint(remoteMessage.appData)
    }

}
caiovidaln commented 7 years ago

I have the same problem.

alexanderkhitev commented 7 years ago

Hi @caiovidaln ! Please see my answer on my question https://stackoverflow.com/questions/46391818/fcm-push-notifications-do-not-work-on-ios-11 It helped me, I'm currently testing, so that everything works as before, but unfortunately it will be necessary to wait until Apple confirms the new Build.

berlininsomniac commented 7 years ago

We have the same issue. Once the app goes into the background, no pushes are received at all.

visskiss commented 7 years ago

Also not receiving push notifications with iOS 11 and latest firebaseMessaging 2.0.3, firebase 4.2.0. I have used the apps.sh script to test and i receive those notifications, but using the fcm id and sending through the console and I receive nothing.

I just did a drop in replace from previous version 1.2.1 and 3.11.1 (had to add one delegate function for token update).

ordinaryman09 commented 7 years ago

I noticed from your code, you're not running the request for push authorization from application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions, perhaps you call it at later time?

I have similar issue. I updated to Firebase 4.2.0 and FirebaseMessaging 2.0.3, my issue is I'm not getting notification if I do request push notification at later time. (I'm doing soft request/custom dialog to check if user want to receive push notification, before using the system request). I was able to reproduce it from the quickstart project by adding a delay to the requestAuthorization for push. Here's my SO thread: https://stackoverflow.com/questions/46443189/firebase-messaging-not-sending-notification-when-push-notification-authenticatio

rsattar commented 7 years ago

There is a known issue where the FCM token is not always being associated with the APNs device token if UIApplication.shared.registerForRemoteNotifications() is not called early enough. This has already been fixed in the FirebaseInstanceID SDK, and should be coming out soon.

In the meantime, you can:

  1. Lock your FirebaseInstanceID pod to 2.0.0 in your Podfile, or

  2. Ensure you're calling UIApplication.shared.registerForRemoteNotifications() on app start, ideally before FirebaseApp.configure().

For testing, you can trigger a new FCM token by uninstall/reinstall your debug app on your device.

ordinaryman09 commented 7 years ago

Got it. do you have any ETA when the version will be released? Tried to lock it, setting pod 'FirebaseInstanceID', '~> 2.0.0' , but it kept using the 2.0.3, How do I downgrade it?

jetboh commented 7 years ago

@rsattar Thanks so much! Locking FirebaseInstanceID to 2.0.0 worked for me. @ordinaryman09 remove the arrow for an exact match: pod 'FirebaseInstanceID', '2.0.0'

morganchen12 commented 7 years ago

@ordinaryman09 to specify exact versions, you should use '= 2.0.0'. CocoaPods' ~> specifier will use the most recent compatible version.

vazkir commented 7 years ago

Both downgrading the FirebaseInstanceID and FirebaseMessaging and placing the UIApplication.shared.registerForRemoteNotifications() as the first thing in the didFinishLaunchingWithOptions still doesn't work and gives a similar error. Is there anything else I can do?

rsattar commented 7 years ago

@10686142 try uninstalling the app and reinstalling with the code changes, to ensure that a new FCM token gets issued

vazkir commented 7 years ago

Yeah somehow I still can't get it to work, but maybe I did something wrong since I am new to this. But maybe someone knows what it can be: I followed this tutorial: https://www.youtube.com/watch?v=_jy_Hlskmiw&t=710s Which came down to me delegate looking like this: https://github.com/douglasdevelops/PushNotificationSample/blob/master/PushNotificationSample/AppDelegate.swift

Is he maybe missing something is his explanation or am I missing something?

Thanks in advance!

richardliveraise commented 7 years ago

Thanks @jtbh89 & @rsattar , I downgraded to 2.0.0 and it works for me now. @10686142 what messages are you seeing? Do you get the tokens?

vazkir commented 7 years ago

2017-09-28 21:26:20.067218+0200 App Imperium News[1026:80671] [Firebase/Messaging][I-FCM002019] FIRMessaging received data-message, but FIRMessagingDelegate's-messaging:didReceiveMessage: not implemented 2017-09-28 21:27:05.337971+0200 App Imperium News[1026:80673] TIC Read Status [5:0x0]: 1:57 2017-09-28 21:27:05.338807+0200 App Imperium News[1026:80673] TIC Read Status [5:0x0]: 1:57

vazkir commented 7 years ago

Yeah I did also receive the token. And I got it to work earlier today that I could also see the push notification message in my debug log, but I always get that message about FIRMessagingDelegate's-messaging:didReceiveMessage: not implemented

vazkir commented 7 years ago

I got it to work finally guys! I added this piece of code: func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { Messaging.messaging().apnsToken = deviceToken }

vazkir commented 7 years ago

Beginners mistake I think, thanks for your help! @rsattar @richardliveraise

ordinaryman09 commented 7 years ago

it works for me after downgrading to 2.0.0, thanks guys!

driverslicense commented 7 years ago

@rsattar Without using CocoaPods, how is it possible to downgrade to 2.0.0 to fix this? Can you provide a link to download the working framework(s)?

morganchen12 commented 7 years ago

@candywriter you can download the tar.gz from the link in the 2.0.0 podspec without using CocoaPods.

https://dl.google.com/dl/cpdc/9fe91bfb8772be4b/FirebaseInstanceID-2.0.0.tar.gz

driverslicense commented 7 years ago

@morganchen12 Thanks! Unfortunately manually replacing FirebaseInstanceID 2.0.3 with 2.0.0 produces a host of build errors.

visskiss commented 7 years ago

I had no issues. Are you on the latest download besides that?

phr85 commented 7 years ago

Try to set this, works for me:

Messaging.messaging().shouldEstablishDirectChannel = true

phr85 commented 7 years ago

Sorry, my memories solution isn't really the solution. Message just arrived when app is active.

farazq commented 7 years ago

Downgrading FirebaseInstanceID to 2.0.0 did not work for me either. However, adding this did work: Messaging.messaging().apnsToken = deviceToken in didRegisterForRemoteNotificationsWithDeviceToken

I'm confused why it works because this is only supposed to be in place if you have swizzling disabled, which I don't.

caiovidaln commented 7 years ago

The solutions presented above did not work for me. I am using FirebaseInstanceID: 2.0.0, FirebaseMessaging: 2.0.0, FirebaseCore: 4.0.7, Firebase: 4.2.0 and FirebaseAnalytics: 4.0.3. Testing with iOS 11.

The message arrives with the application active, but it does not arrives when is in background.

extension AppDelegate: UNUserNotificationCenterDelegate {
    // Receive displayed notifications for iOS 10 devices.
    func userNotificationCenter(_ center: UNUserNotificationCenter,
                                willPresent notification: UNNotification,
                                withCompletionHandler completionHandler:
        @escaping (UNNotificationPresentationOptions) -> Void) {
        completionHandler(.alert)
    }

    func userNotificationCenter(_ center: UNUserNotificationCenter,
                                didReceive response: UNNotificationResponse,
                                withCompletionHandler completionHandler: @escaping () -> Void) {
        completionHandler()
    }

    func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
        Messaging.messaging().apnsToken = deviceToken
    }

    func registerForPushNotifications(application: UIApplication) {

        FirebaseApp.configure()
        application.registerForRemoteNotifications()

        UNUserNotificationCenter.current().delegate = self

        let authOptions: UNAuthorizationOptions = [.alert, .badge, .sound]
        UNUserNotificationCenter.current().requestAuthorization(
            options: authOptions,
            completionHandler: {_, _ in })

        Messaging.messaging().delegate = self
    }

    func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
        print("Notification: Unable to register for remote notifications: \(error.localizedDescription)")
    }

    func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any]) {
        NotificationCenterController.processMessage(userInfo)
    }

    func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
        NotificationCenterController.processMessage(userInfo)
        completionHandler(.newData)
    }

}

extension AppDelegate: MessagingDelegate {
    func messaging(_ messaging: Messaging, didRefreshRegistrationToken fcmToken: String) {
        print("Refresh Token")
    }

    // Receive data message on iOS 10 devices while app is in the foreground.
    func application(received remoteMessage: MessagingRemoteMessage) {
        NotificationCenterController.processMessage(remoteMessage.appData)
    }

}

UPDATE Actually I noticed that the message is coming in the background, but it is only processed when the application is opened.

royherma commented 7 years ago

+1, using all new (Podfile.lock)

- Firebase/Core (4.2.0):
    - FirebaseAnalytics (= 4.0.3)
    - FirebaseCore (= 4.0.7)
  - Firebase/Database (4.2.0):
    - Firebase/Core
    - FirebaseDatabase (= 4.0.3)
  - Firebase/Messaging (4.2.0):
    - Firebase/Core
    - FirebaseMessaging (= 2.0.3)

Confirmed able to get push by APNS directly, not able to get push from firebase api/notification panel.

lsalvoni commented 7 years ago

+1 to @farazq and overriding the swizzling method(s); even though I have set FirebaseAppDelegateProxyEnabled to NO in the Info.plist as the docs state, it seems to have no effect. (ie I am opting to NOT use method swizzling)

Using Cocoapods and FirebaseCore (4.0.7) FirebaseMessaging (2.0.3) for reference.

royherma commented 7 years ago

@lsalvoni I spent a few hours trying to understand wasn't working till i got to this thread.

The solution was moving my pods to this:

    pod 'Firebase/Core', '4.0.4'
    pod 'Firebase/Database', '4.0.4'
    pod 'Firebase/Messaging', '4.0.4'
    pod 'FirebaseInstanceID', '2.0.0'
Kharauzov commented 7 years ago

I just also met the same problem. O my god, I spent about 2 hours on nothing trying to fix the problem with the certificates and provision profiles. But the only solution, that worked for me was to decrease 'FirebaseInstanceID' version to 2.0.0. After this notifications started to deliver on my iOS device.

rsattar commented 7 years ago

Hey everyone, we released FirebaseInstanceID 2.0.4 today, which should be resolving a lot of the issues related to notification delivery. Please update to that if you're still having trouble.

xeneka commented 7 years ago

Hi, I update to FirebaseInstanceID 2.0.4 but not working

o15a3d4l11s2 commented 7 years ago

Not working for me too. Still not receiving the notifications :(

rsattar commented 7 years ago

@xeneka @o15a3d4l11s2 How are you sending the notification request? Firebase Notifications console? FCM HTTP API? If API, what parameters are you sending? Are you including the notification key in the request?

xeneka commented 7 years ago

I send notification with console of fireblade y with curl. the old version of app receive notification

import UIKit import Fabric import Crashlytics import UserNotifications import FirebaseCore import Firebase import FirebaseMessaging

fileprivate let viewActionIdentifier = "VIEW_IDENTIFIER" fileprivate let newsCategoryIdentifier = "NEWS_CATEGORY"

@UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    Fabric.with([Crashlytics.self])
    UNUserNotificationCenter.current().delegate = self

    // Override point for customization after application launch.
    registerForPushNotifications()

    // 1
    if let notification = launchOptions?[.remoteNotification] as? [String: AnyObject] {
        // 2
        let aps = notification["aps"] as! [String: AnyObject]
        print(aps)
        //_ = NewsItem.makeNewsItem(aps)
        // 3
       // (window?.rootViewController as? UITabBarController)?.selectedIndex = 1
    }

    FirebaseApp.configure()
    connectToFcm()
    Fabric.with([Crashlytics.self])

    return true
}

func applicationWillResignActive(_ application: UIApplication) {
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}

func applicationDidEnterBackground(_ application: UIApplication) {
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.

    Messaging.messaging().disconnect()
    print("Disconnected from FCM.")

}

func applicationWillEnterForeground(_ application: UIApplication) {
    // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(_ application: UIApplication) {
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(_ application: UIApplication) {
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

////MARK: - Notification

// ojo fastlane sigh --development para generar certificado de develop

func application(_ application: UIApplication,
                 didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {

    let tokenParts = deviceToken.map { data -> String in
        return String(format: "%02.2hhx", data)
    }

    let token = tokenParts.joined()
    print("Device Token: \(token)")

    let tokenFIR = Messaging.messaging().fcmToken
    print("FIER TOKEN \(tokenFIR) fin")

}

/*func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) {

    print(userInfo)
}*/

func application(
    _ application: UIApplication,
    didReceiveRemoteNotification userInfo: [AnyHashable : Any],
    fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {

    let aps = userInfo["aps"] as! [String: AnyObject]

    if aps["content-available"] as? Int == 1 {
        /*let podcastStore = PodcastStore.sharedStore
        podcastStore.refreshItems { didLoadNewItems in
            completionHandler(didLoadNewItems ? .newData : .noData)
        }*/
    } else  {
        //_ = NewsItem.makeNewsItem(aps)
        completionHandler(.newData)
    }
}

func application(_ application: UIApplication,
                 didFailToRegisterForRemoteNotificationsWithError error: Error) {
    print("Failed to register: \(error)")
}

func registerForPushNotifications() {
    UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) {
        (granted, error) in
        print("Permission granted: \(granted)")

        guard granted else { return }

        let viewAction = UNNotificationAction(identifier: viewActionIdentifier,
                                              title: "View",
                                              options: [.foreground])

        let newsCategory = UNNotificationCategory(identifier: newsCategoryIdentifier,
                                                  actions: [viewAction],
                                                  intentIdentifiers: [],
                                                  options: [])

        UNUserNotificationCenter.current().setNotificationCategories([newsCategory])

        self.getNotificationSettings()
    }
}

func getNotificationSettings() {
    UNUserNotificationCenter.current().getNotificationSettings { (settings) in
        print("Notification settings: \(settings)")
        guard settings.authorizationStatus == .authorized else { return }
        DispatchQueue.main.async{
        UIApplication.shared.registerForRemoteNotifications()
        }
    }
}

// Firebase

func connectToFcm() {

    Messaging.messaging().shouldEstablishDirectChannel = true
    Messaging.messaging().connect { (error) in
        if (error != nil) {
            print("Unable to connect with FCM. \(error ?? "Sin error" as! Error)")
        } else {
            print("Connected to FCM.")
        }
    }
}

//Init session y login and pass in keychain

func loginWithKeychain() -> Bool{
    let keychainManager = userLoginKeychainManager()

    do {
        let user = try keychainManager.recoverData()
        if (!userManagerSession.getLogged()){
            userManagerSession.sharedInstance.initWithLogin(login: user)
        }
        return true
    }catch {
        print("User no register")
        return false
    }

}

}

extension AppDelegate: UNUserNotificationCenterDelegate {

func userNotificationCenter(_ center: UNUserNotificationCenter,
                            didReceive response: UNNotificationResponse,
                            withCompletionHandler completionHandler: @escaping () -> Void) {

    let userInfo = response.notification.request.content.userInfo
    let aps = userInfo["aps"] as! [String: AnyObject]

    /*if let newsItem = aps {
        (window?.rootViewController as? UITabBarController)?.selectedIndex = 1

        if response.actionIdentifier == viewActionIdentifier,
            let url = URL(string: newsItem.link) {
            //let safari = SFSafariViewController(url: url)
            //window?.rootViewController?.present(safari, animated: true, completion: nil)
        }
    }*/

    completionHandler()
}

}

extension AppDelegate : MessagingDelegate { func messaging(_ messaging: Messaging, didRefreshRegistrationToken fcmToken: String) { print(messaging) }

func messaging(_ messaging: Messaging, didReceive remoteMessage: MessagingRemoteMessage) {
    print("mesaje")
}

// Receive data message on iOS 10 devices.
func application(received remoteMessage: MessagingRemoteMessage) {
    print("%@", remoteMessage.appData)
}

}

o15a3d4l11s2 commented 7 years ago

@rsattar I am sending notifications through https://console.firebase.google.com. If I target a specific FCM token the notification is sent, but sending to a User Segment -> App does nothing.

I register the token manually

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
    Messaging.messaging().apnsToken = deviceToken
}

but this does not help.

I have tried using 'FirebaseInstanceID', '2.0.0' with no success.

I have also moved UIApplication.shared.registerForRemoteNotifications() on app start, before FirebaseApp.configure() with no success.

whdinata commented 7 years ago

Hi @rsattar,

I have exactly the same problem as what @o15a3d4l11s2 has. It would be great if we can hear from you soon.

driverslicense commented 7 years ago

Agree with all of the other posters: upgrading to Firebase 4.3 (and more specifically FirebaseInstanceID 2.0.4) does not fix the broken push notifications on iOS. Really poor effort by the Firebase team.

evollu commented 7 years ago

@candywriter are you saying 2.0.0 works for you and upgrading to 2.0.4 made it fail again?

keitaoouchi commented 7 years ago

In iOS11.0, there seems to be a problem with iOS itself in handling silent push notification. https://stackoverflow.com/questions/44796613/silent-pushes-not-delivered-to-the-app-on-ios-11

o15a3d4l11s2 commented 7 years ago

@keitaoouchi I don't believe this is the reason for not receiving the notifications. They say this issue mentioned in StackOverflow is already fixed. Even if it is not - I experience a different issue - I always receive the push notifications when targeting a single device and very rarely receive notifications when sending to a User Segment.

shintegu commented 7 years ago

I'm also encountering the issue of @o15a3d4l11s2. I can receive push notifications by sending message to a single device, but almost nothing when using User Segment.

eduardoParadoja commented 7 years ago

I wasn't receiving any notifications until I deleted the .p12 files from the firebase console and upload the .p8 file https://stackoverflow.com/questions/39672297/how-to-use-apples-new-p8-certificate-for-apns-in-firebase-console

o15a3d4l11s2 commented 7 years ago

@eduardoParadoja Thanks for the suggestion. I use APN Auth Key and not APN Push Certificate.

jacobmoncur commented 7 years ago

I am seeing the exact same issue as @o15a3d4l11s2.

We are using the console (https://console.firebase.google.com) to send notifications. If I target an individual device using the FCM token the notification is received. If I try to send to a User Segment the notification is not received. :shrug:

amervil commented 7 years ago

Exact the same issue as @jacobmoncur. Even same versions of Firebase, .p8, Xcode 9

vincentsong commented 7 years ago

Same issue as @jacobmoncur's. We need to ask user give permission to push notification after FirebaseApp configuration.

ericklarac commented 7 years ago

How do I use this solution? fix is pod 'FirebaseInstanceID', "2.0.0"

HELP, PLEASE.

ordinaryman09 commented 7 years ago

@ericklarac You add it on your Podfile

johnnyrockenstein commented 7 years ago

Pods: pod 'Firebase/Core', '4.0.4' pod 'Firebase/Database', '4.0.4' pod 'Firebase/Messaging', '4.0.4' pod 'FirebaseInstanceID', '2.0.0'

Getting 2017-10-11 00:45:28.181 Customer Connect[1964] [Firebase/Messaging][I-FCM002019] FIRMessaging received data-message, but FIRMessagingDelegate's-messaging:didReceiveMessage: not implemented

Any suggestions?