Fire base update from 2.5.1 to 3.2.1

I tried updating Firebase to 3.2.1 , but I ran into a bunch of errors.

1- The first error I encounter was earlier, I used (authData: FAuthData) , but after the update I started to get the error:

Using the Undeclared Type FAuthData


2- For the links I used ..

 let rootRef = Firebase(url:dataURL) rootRef.unauth() 

Now I tried to change it to

 let rootRef = FIRApp(named: dataURL) // it forces me change into that, rootRef.unauth() // and this line throws an error. 

Value of type FIRApp? doesn't have a member unauth

3- Similarly, if I use

 let loginRef = FIRApp(named: dataURL) loginRef.authUser( // has no member `authUser` 

4 Finally, it does not allow me to put FIRApp.configure() in AppDelegate, although I used import Firebase . He doesn't seem to know about FIRApp in AppDelegate.

How can I upgrade Firebase from 2.5.1 to 3.2.1? Is there a guide to updating it? What am I missing / wrong?

+1
source share
1 answer

This question has already been answered -

Why won't my Firebase pod 3.x install correctly?

Here are the highlights -

 pod update 

You need to run pod update once before installing the Firebase module, and it will install the correct version the next time you do it.

Please check the original answer for further explanation.

UPDATE

FIRAuth may be what you are looking for in 3.x

From Documents -

Update your authentication code

 FIRAuth.auth()!.signInAnonymouslyWithCompletion() { (user, error) in if let error = error { print("Sign in failed:", error.localizedDescription) } else { print ("Signed in with uid:", user!.uid) } 

}

For login ( unauth in your case) -

 try! FIRAuth.auth()!.signOut() 

This should definitely work. Of course, you need to add GoogleService-Info.plist to your project from the firebase console, as indicated in the comments.

+3
source

All Articles