mardi 28 juin 2016

Trying to connect Facebook login via FirebaseUI Auth but having an issue with authUI.delegate = self

I am attempting to connect Facebook login via FirebaseUI Auth however I cannot get the Facebook connect button to appear in the instanced authViewController. Platform: iOS, Language: Swift 2.0, Latest stable Xcode release

Everything is working as it should as far as pulling up an instanced authViewController. The e-mail/password option is present and actively creates a new user in my Firebase database.

The problem I am having occurs when trying to implement Facebook login functionality;

In my AppDelegate.swift file I have the following:

import Firebase
import FirebaseAuthUI
...
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

    FIRApp.configure()
    let authUI = FIRAuthUI.authUI()!
    authUI.delegate = self

    return true
}

The error I'm getting is "Cannot assign value of type 'AppDelegate' to type 'FIRAuthUIDelegate'" - basically I can't get the following line to work; authUI.delegate = self

I have read all documentation and browsed open/closed issues on implementation at the project's gitHub repo here: https://github.com/firebase/FirebaseUI-iOS/tree/master/FirebaseUI

I have looked over a previous StackOverflow question that is similar in nature here; How to use FirebaseUI for Google authentication on iOS in Swift?

I have attempted to copy the code from the above Stack Overflow since he states he did get more options to appear using his code (his question is about an error further down the line regarding authentication) but I still run into the same self delegation error. I have tried assigning FIRAuthUIDelegate to AppDelegate but it does not conform. What am I missing?

Aucun commentaire:

Enregistrer un commentaire