https://github.com/firebase/firebase-ios-sdk
Download starter project for this video here
Intermediate
Firebase website: https://firebase.google.com
Firebase documentation: https://firebase.google.com/docs/
Adding Firebase to Xcode project: https://firebase.google.com/docs/ios/setup?authuser=0
Intro to Firebase Authentication: https://firebase.google.com/docs/auth/
Intro to Firebase Authentication in iOS: https://firebase.google.com/docs/auth/ios/start
Firebase documentation on Google Sign In on iOS: https://firebase.google.com/docs/auth/ios/google-signin
Firebase Auth error handling: https://firebase.google.com/docs/auth/ios/errors
Google sign in documentation: https://developers.google.com/identity/sign-in/ios?authuser=0
Firebase iOS SDK Github repository: https://github.com/firebase/firebase-ios-sdk
In this video, we will be talking about how you can allow your users to sign into your Firebase iOS app with their Google accounts. We will be taking a look at how we can add a button in a view controller to allow the user to tap onto it so that they can sign in. By tapping that button, we will present a view controller that allows the user to enter their username and password of their Google accounts in order to sign in. Depending on whether if the sign in was a success or a failure, we will work with the GIDSignInDelegate to handle both situations. For example, if the sign in was a success, we want to display another view controller, but if the sign in was a failure for any reason, we want to display an alert for the user, letting them know that there is something wrong.
In this tutorial we’re using storyboard to create our user interface. According to Firebase’s documentation, we’re inserting a UIView into the view controller, then we set its UIView custom class to GIDSignInButton. Note that the button won’t appear in the storyboard file, you have to run the app in order to see the button.
The GIDSignInButton is designed so that when we click on that button, without the need to call the sign in function manually, it will present a view controller where we can sign into a Google account, with a familiar Google sign in interface. After successful sign in, we obtain the credentials then authenticate into our Firebase application.
A simple do-catch statement in the IBAction method of our sign out button will sign us out of the Firebase application quickly when the user taps on the button when signed in.
You may download the source code of the final project for reference here
All previous Firebase episodes are made before my transition from YouTube to DTube, so my Firebase YouTube video tutorial links for episode 1 to 8 are included here.