use of unresloved identifier FIRMessaging

GrayFox picture GrayFox · Jul 8, 2016 · Viewed 11.8k times · Source

I'm facing a strange issue during integration of the Firebase Notification new API in my iOS Swift App. I encounter some difficulties receiving a push Notification sent from the Firebase web plateform. My certificate is OK since I tested it with a quick PHP script to send a test notification to my phone.

In this post : https://stackoverflow.com/a/37467793/5082848 , it is said to add in AppDelegate

func applicationDidBecomeActive(application: UIApplication) {
    FIRMessaging.messaging().connectWithCompletion { error in
        print(error)
    }
}

However, FIRMessaging is unknown, whereas my podfile correctly contains Firebase/Messaging . Here is what the terminal returns after pod install :

Using Firebase (3.3.0)

Using FirebaseAnalytics (3.2.1)

Using FirebaseInstanceID (1.0.7)

Using GoogleInterchangeUtilities (1.2.1)

Using GoogleSymbolUtilities (1.1.1)

Using GoogleUtilities (1.3.1)

Do you have any clue please ? Thanks a lot

Answer

t4nhpt picture t4nhpt · Jul 8, 2016

You should import FirebaseMessaging

import FirebaseMessaging