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

ความคิดเห็น • 24

  • @angelcamacho9009
    @angelcamacho9009 ปีที่แล้ว

    amazing video man! thank you so so much!!!

  • @ItsIan.
    @ItsIan. ปีที่แล้ว +1

    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)

  • @create-mern-app
    @create-mern-app หลายเดือนก่อน

    Thank you so much for the incredibly helpful video!

  • @devkunjadia
    @devkunjadia ปีที่แล้ว

    Thank you so much for this video!!! I will be sharing this on all the platforms I know of!!!

    • @weschua
      @weschua  ปีที่แล้ว

      Thanks for the sharing. Your message motivate me to create more of these contents

  • @ayojaydeee8910
    @ayojaydeee8910 หลายเดือนก่อน

    THANK YOU!

  • @abdussametkaya4306
    @abdussametkaya4306 หลายเดือนก่อน

    thank you

  • @weschua
    @weschua  ปีที่แล้ว +5

    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

  • @weschua
    @weschua  ปีที่แล้ว

    If you need any help or any issue, please comment down below and I will reply you ASAP.

  • @MounirAbdellaoui-ue9hq
    @MounirAbdellaoui-ue9hq ปีที่แล้ว

    can you post the same login but without google sign in?
    love your video btw :)

    • @weschua
      @weschua  ปีที่แล้ว +1

      Thanks. I am preparing to do login with email and password with email verification. It should be out in early feb.

  • @jlambert12013
    @jlambert12013 ปีที่แล้ว

    Has anyone else had problems with Firebase Syntax Highlighting not working correctly on Xcode?

  • @daisensei5391
    @daisensei5391 ปีที่แล้ว +1

    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!

    • @weschua
      @weschua  ปีที่แล้ว

      Thank you for watching. Can you state which code you meant and the error message?

    • @sushmasingh8171
      @sushmasingh8171 ปีที่แล้ว

      Same i also got that

  • @joelamarh2910
    @joelamarh2910 ปีที่แล้ว

    is it possible to get the first name and surname from the gmail account?

    • @weschua
      @weschua  ปีที่แล้ว +1

      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.

    • @joelamarh2910
      @joelamarh2910 ปีที่แล้ว

      ​@@weschua Thanks you so much. I have a other question it possible to only allow specific google emails to enter the content view.

    • @weschua
      @weschua  ปีที่แล้ว

      @@joelamarh2910 What do you mean by specific google emails? can you give some example?

  • @prairieln
    @prairieln ปีที่แล้ว

    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!

    • @weschua
      @weschua  ปีที่แล้ว

      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

    • @prairieln
      @prairieln ปีที่แล้ว

      @@weschua I will give it a try. You are the best, Wes!