iOS10, Swift 3 und FCM delegieren Fehler

Ich erhalte den Fehler:

"Value of type FIRMessaging has no member 'remoteMessageDelegate'" on FIRMessaging.messaging().remoteMessageDelegate = self

Ich erhalte diesen Code aus der FCM-Installationsanleitung:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    // Override point for customization after application launch.

    if #available(iOS 10.0, *) {
        let authOptions : UNAuthorizationOptions = [.alert, .badge, .sound]
        UNUserNotificationCenter.current().requestAuthorization(
            options: authOptions,
            completionHandler: {_,_ in })

        // For iOS 10 display notification (sent via APNS)
        UNUserNotificationCenter.current().delegate = self
        // For iOS 10 data message (sent via FCM)
        FIRMessaging.messaging().remoteMessageDelegate = self //Get error on this line

    } else {
        let settings: UIUserNotificationSettings =
            UIUserNotificationSettings(types: [.alert, .badge, .sound], categories: nil)
        application.registerUserNotificationSettings(settings)
        application.registerForRemoteNotifications()
    }

Antworten auf die Frage(10)

Ihre Antwort auf die Frage