Login using Firebase Google Sign In with SwiftUI
ฝัง
- เผยแพร่เมื่อ 11 ก.ค. 2024
- Learn how to let your users authenticate with Firebase using their Google Accounts by integrating Google Sign-In into your app with SwiftUI. If you read at the official documentation, the steps are not for SwiftUI but for UIKit. By watching this video, you can learn to do this with SwiftUI.
Starting Project: github.com/WesCSK/SwiftUI-Fir...
Completed Project: github.com/WesCSK/SwiftUI-Fir...
Official Firebase Doc: firebase.google.com/docs/auth...
Outline
0:00 What will you be creating
2:00 Project Introduction
3:33 Create and setup Firebase Project
4:36 Add FirebaseAuth SDK
5:15 Add AppDelegate
7:14 Firebase Authentication Setup
7:40 1. Add GoogleSignIn SDK
8:45 2.1 Add custom URL schemes to your Xcode project
10:20 2.3 Implement the application:openURL:options: method
11:00 2.4 Pass the presenting view controller and client ID for your app to the Google Sign In sign-in method and create a Firebase auth credential from the resulting Google auth token
11:55 Create UIViewController
15:00 3. Authenticate with Firebase
16:40 AppStorage (Go to Home Screen)
17:55 Refactor code
===================================
Follow me!
Instagram (Personal): / sweekwang
Instagram (iOS Content): / iosappdevs
Twitter: / wescsk
Linkedin: / sweekwang
#firebaseauth #swiftui #google #sign #swift #swiftdeveloper
amazing video man! thank you so so much!!!
Great video Wes! Easy to follow along and very helpful!
For anyone having trouble with 12:21 just add return to the empty spaces. (For context, Firebase updated their syntax)
Thank you so much for the incredibly helpful video!
Thank you so much for this video!!! I will be sharing this on all the platforms I know of!!!
Thanks for the sharing. Your message motivate me to create more of these contents
THANK YOU!
thank you
If you are using google sign in version 7.0.0, there following method is not available. "GIDSignIn.sharedInstance.signIn(with: config, presenting: getRootViewController())". However, you can modify your code to the one shown below. I will update this video soon.
github.com/WesCSK/SwiftUI-Firebase-Authenticate-Using-Google-Sign-In/blob/starting/README.md#updated-steps-for-v700-of-google-signin
If you need any help or any issue, please comment down below and I will reply you ASAP.
can you post the same login but without google sign in?
love your video btw :)
Thanks. I am preparing to do login with email and password with email verification. It should be out in early feb.
Has anyone else had problems with Firebase Syntax Highlighting not working correctly on Xcode?
I followed the guide of the 7.0.0 update and got an "Extra trailing closure passed in call" error on my GoogleSignInButton. Any thoughts on that? Thanks!
Thank you for watching. Can you state which code you meant and the error message?
Same i also got that
is it possible to get the first name and surname from the gmail account?
Yes. If you look at the user object we get after GIDSignIn.sharedInstance.signIn, the user is a GIDGoogleUser, and you can get the full name by calling user.profile?.name.
@@weschua Thanks you so much. I have a other question it possible to only allow specific google emails to enter the content view.
@@joelamarh2910 What do you mean by specific google emails? can you give some example?
I'm running into the "Type of expression is ambiguous without more context" error, with the line "GIDSignIn.sharedInstance.signIn(with: config, presenting: getRootViewController())". Any thought why? Thank you!
Hello, there is a update in Google sign in to version 7. Thus, this method is not available. I will create a new video soon to update this. If you want to continue with this video, you can
1. Use version 6.2.4. This is a temporary solution.
2. Modify the code changes for "GIDSignIn.sharedInstance.signIn(with: config, presenting: getRootViewController())" to the one show here github.com/WesCSK/SwiftUI-Firebase-Authenticate-Using-Google-Sign-In/blob/starting/README.md#updated-steps-for-v700-of-google-signin
@@weschua I will give it a try. You are the best, Wes!