Swift: Sign In with Google & Firebase (Swift 5, Xcode 11) - Beginners

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ก.พ. 2025

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

  • @randomrobot6167
    @randomrobot6167 4 ปีที่แล้ว +3

    this is honestly the best swift tutorials channels! I am so happy it got recommended

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

      Im super glad you like the content! Thanks so much for watching - many more to come!

  • @TamoKakhidze
    @TamoKakhidze 7 หลายเดือนก่อน +1

    can I add this package without cocoapods?

  • @ajhernandez15200
    @ajhernandez15200 4 ปีที่แล้ว +3

    Your tutorials are really easy to understand and digest!

  • @evanzhang3875
    @evanzhang3875 4 ปีที่แล้ว +3

    Thank you so much for the help! I'm creating my first app, and these tutorials have really been saving me a lot of time. Great work and keep it up!

    • @iOSAcademy
      @iOSAcademy  4 ปีที่แล้ว

      Hey Evan, I really appreciate it! These comments keep me motivated and creating new videos :)

    • @adensylas3943
      @adensylas3943 3 ปีที่แล้ว

      I dont mean to be off topic but does anyone know of a way to log back into an instagram account??
      I was dumb lost my login password. I would love any tricks you can offer me

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

    Clang: error: linker command failed with exit code 1 (use -v to see invocation)
    Plx help

  • @davidandersson8926
    @davidandersson8926 4 ปีที่แล้ว +3

    I have this error: Missing argument for parameter 'sourceApplication' in call in return GIDSignIn.sharedInstance().handle(url) do you know how to fix it?

  • @hamidez-yara3605
    @hamidez-yara3605 2 ปีที่แล้ว +1

    Thanks for the excellent video tutorials. if you can, please update this tutorial as well.

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

    You should do swift UI next just because that is what apple supports more now

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

    where is this code in the github repository? Im already a Patreon user

  • @jofresh228
    @jofresh228 4 ปีที่แล้ว +3

    How do you make the segue to an other view after having signing with Google?

    • @davidandersson8926
      @davidandersson8926 4 ปีที่แล้ว

      very good question! I'm stuck here too!

    • @sarthaktanejablogger
      @sarthaktanejablogger 4 ปีที่แล้ว

      Hey.
      Go to the method sign( signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) {
      if let error = error { return }
      // Do the functionality that you want to do after sign in
      pushToViewController()
      }

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

    FANTASTIC VIDEO!

  • @BenGerhold
    @BenGerhold 2 ปีที่แล้ว +2

    Unfortunately this is outdated now with version 6 of Google Sign in for iOS

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

      New video coming soon

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

    Best Channel.

    • @iOSAcademy
      @iOSAcademy  3 ปีที่แล้ว

      Thanks!

    • @afaaqahmedsaqi
      @afaaqahmedsaqi 3 ปีที่แล้ว

      Your tutorials really help me to develop apps for client as I am noob. Eventually which helps me and my family to stay financially stable.
      Lots of love 💕

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

    Hello! I found a problem for people who use SwiftUI instead of UIKit, what to do when you don't have ViewController?

  • @MaximosXu
    @MaximosXu 4 ปีที่แล้ว +6

    How do I segue to a new view controller after doing this tutorial? The google log in works now but I'm not sure how to go to a home screen instead of just staying on a log in screen.

    • @nigelsmith421
      @nigelsmith421 4 ปีที่แล้ว

      Yes, I'm puzzled too!

    • @davidandersson8926
      @davidandersson8926 4 ปีที่แล้ว

      yes me too!!!!

    • @sarthaktanejablogger
      @sarthaktanejablogger 4 ปีที่แล้ว

      Hey.
      Go to the method sign( signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) {
      if let error = error { return }
      // Do the functionality that you want to do after sign in
      pushToViewController()
      }

    • @icodethis
      @icodethis 4 ปีที่แล้ว

      I found this solution
      self.window?.rootViewController!.performSegueWithIdentifier("YOUR SEGUE IDENTIFIER", sender: nil)

  • @HirenMistry0125
    @HirenMistry0125 4 ปีที่แล้ว +2

    hello sir,
    i follow your steps and get stuck error at "FirebaseApp.configure()" - use pf unresolved identifier 'FirebaseApp.configure'
    what should i do?

    • @iOSAcademy
      @iOSAcademy  4 ปีที่แล้ว

      Did you import firebase

    • @HirenMistry0125
      @HirenMistry0125 4 ปีที่แล้ว

      iOS Academy yes sir i import firebase

    • @bujbaraa
      @bujbaraa 4 ปีที่แล้ว

      same error

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

      You should write -> FIRApp.configure()

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

    Thanks man )

  • @nigelsmith421
    @nigelsmith421 4 ปีที่แล้ว

    The sign-in silently statement is:
    GIDSignin.sharedInstance()?,signInSilently()

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

    Informative video. Does the app have to restart to get values? Getting an update mid running (e.g. new app version available) would be useful. Somer apps might be loaded for many days by iOS before a restart happens.

    • @iOSAcademy
      @iOSAcademy  2 ปีที่แล้ว

      Thanks. Nope, you can queue fetches

  • @hakankumdakc9233
    @hakankumdakc9233 3 ปีที่แล้ว

    Migrated to new version at 6.0.0. So it doesn't have delegate anymore.

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

    Thanks a lot. Very exiting and usefull tutorials. Pls keep up.

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

    I followed the tutorial and everything works. But when I try to Sign In with Google and then hit Cancel it crashes the app giving me this error in the App Delegate: "Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value"

  • @mingy7017
    @mingy7017 4 ปีที่แล้ว

    I was in Big Sur beta 11.0, and that OS version caused a huge problem for doing this. And everything went back to normal after I changed back to Catalina.

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

    I would totally buy your courses !

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

      Im super pumped for this course Im putting together. Make sure to join the waitlist to be notified at ios.academy/waitlist

  • @ЯрославГрицунь
    @ЯрославГрицунь 3 ปีที่แล้ว

    if the Google app is installed, can we redirect the user to the app, where it is already signed in?

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

    please provide source code,...what you do in the video..it will be very help ful for us...by the way nice video...we enjoy and learn lots of things from your video....

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

      Thanks! Source code is available for newer vids :)

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

    Nice video. I wanted to know how you can open a Home View Controller after user logs in

    • @iOSAcademy
      @iOSAcademy  4 ปีที่แล้ว

      After log in is called, fire off a notification to the VC to present another (Home) VC

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

      @@iOSAcademy I did try this particular code but it didn't work stackoverflow.com/questions/61826939/homeviewcontroller-not-loading-after-firebase-google-signin-in-appdelegate-swift Can you provide me a resource to make it work.

    • @davidandersson8926
      @davidandersson8926 4 ปีที่แล้ว

      @@iOSAcademy from where? the app delegate?

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

    great video! thanks!

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

      Thanks! Glad I could help :)

  • @nigelsmith421
    @nigelsmith421 4 ปีที่แล้ว

    All is fine until 9:22 when I get an error on
    GIDSignIn.sharedInstance().handle(url)
    It says : Missing arguments for parameters 'sourceApplication', 'annotation' in call

    • @iOSAcademy
      @iOSAcademy  4 ปีที่แล้ว

      Yeah you need to add that param and pass in self :)

    • @nigelsmith421
      @nigelsmith421 4 ปีที่แล้ว

      @@iOSAcademy Sorry, that's not clear to me.
      I've tried:
      and that seems to work.

    • @skakwy4335
      @skakwy4335 2 ปีที่แล้ว

      @@iOSAcademy wdym ?

  • @khaledkhan4866
    @khaledkhan4866 4 ปีที่แล้ว

    is it possible to make this google sign in with Webview?

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

    how i can get UID of user??

    • @iOSAcademy
      @iOSAcademy  4 ปีที่แล้ว

      Its off the user.profile object

  • @sewerside5301
    @sewerside5301 4 ปีที่แล้ว

    No such module as fire base help

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

    Good Job ! 👍

  • @diegomallen2603
    @diegomallen2603 4 ปีที่แล้ว

    Love the video!! One thing I found while testing it was when I clicked the button to sign in then pressed cancel, the app would crash. How can I fix this bug??? Keep up the great work!

    • @iOSAcademy
      @iOSAcademy  4 ปีที่แล้ว

      thanks! Hm, it shouldnt crash. A crash log would help

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

      @@iOSAcademy
      IT WILL HELP YOU TO SOLVE THIS PROBLEM. THIS PROBLEM IS OCCUR BECAUSE OF NOT HANDELING NIL IN (CURRENT USER). IF YOU WILL PRESS OPTION BUTTON AND CHECK (CURRENTUSER) TYPE. THEN YOU WILL SEE IT IS FORCE UNWRAPPED. YOU NEED TO HANDLE FORCED UNWRAPPED WITH THE HELP OF THIS FUNCTION ( GIDSignInErrorCode.HasNoAuthKeyInKeychain.RawValue).
      Just Copy it and paste into your AppDelegate file.
      extension AppDelegate: GIDSignInDelegate {
      func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) {
      // Check for sign in error
      if let error = error {
      if (error as NSError).code == GIDSignInErrorCode.hasNoAuthInKeychain.rawValue {
      print("The user has not signed in before or they have since signed out.")
      } else {
      print("\(error.localizedDescription)")
      }
      return
      }
      // Post notification after user successfully sign in
      NotificationCenter.default.post(name: .signInGoogleCompleted, object: nil)
      }
      }

  • @hamzaqaisar2190
    @hamzaqaisar2190 2 ปีที่แล้ว

    This code not authenticate with firebase I not found Google account in user in Firebase

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

    Where can I find the video about Cocoa pods?

    • @iOSAcademy
      @iOSAcademy  4 ปีที่แล้ว

      You can search this channel

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

    I have this error: Thread 1: Exception: "presentingViewController must be set." Which makes the app crash whenever I click the google sign in button. How can I fix it?

    • @asherazeem3282
      @asherazeem3282 4 ปีที่แล้ว

      Yes, i am facing the same error.

    • @asherazeem3282
      @asherazeem3282 4 ปีที่แล้ว

      This is a solution to your error. You can extend your Delegate with this extension it will solve your error.
      extension AppDelegate: GIDSignInDelegate {
      func sign(_ signIn: GIDSignIn!, didSignInFor user: GIDGoogleUser!, withError error: Error!) {
      // Check for sign in error
      if let error = error {
      if (error as NSError).code == GIDSignInErrorCode.hasNoAuthInKeychain.rawValue {
      print("The user has not signed in before or they have since signed out.")
      } else {
      print("\(error.localizedDescription)")
      }
      return
      }
      // Post notification after user successfully sign in
      NotificationCenter.default.post(name: .signInGoogleCompleted, object: nil)
      }
      }

    • @LonlonA
      @LonlonA 4 ปีที่แล้ว

      stackoverflow.com/a/64532164/4819445

  • @mex5341
    @mex5341 3 ปีที่แล้ว +3

    Documentation has changed and video is out of date

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

      New one coming soon

    • @mex5341
      @mex5341 3 ปีที่แล้ว

      @@iOSAcademy thank you!

    • @abrahimmahmud150
      @abrahimmahmud150 3 ปีที่แล้ว

      @@iOSAcademy YESS

    • @ramazan5451
      @ramazan5451 3 ปีที่แล้ว

      @@iOSAcademy good afternoon, and when will the new video on this topic be released?

  • @aqarys.devlog
    @aqarys.devlog 4 ปีที่แล้ว

    Hi! Thank you for tutorial. Is it possible to customize that button. For example, if I want to put just Google icon or label "Sign in with Google"?

    • @iOSAcademy
      @iOSAcademy  4 ปีที่แล้ว

      Youre welcome! Yep, you can absolutely use a custom button as long it meets google brand guidelines

  • @devvailonge
    @devvailonge 3 ปีที่แล้ว

    Noice video tutorial, thanks for sharing it
    One question, why did you set AppDelegate as GIDSignInDelegate and not your ViewController? Any specific reason?

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

      Thanks. Bc Google does a callback for App to launch. I think it has changed since then

  • @mohamadmortada8347
    @mohamadmortada8347 4 ปีที่แล้ว

    Hello, I got a error when I clicked the Sign in button and showed me " terminating with uncaught exception of type NSException " and showed thread 1 signal SIGABRT where the class app delegate is made. Pls help!

    • @iOSAcademy
      @iOSAcademy  4 ปีที่แล้ว

      Can you paste the whole error here please. Either you have not added the url type, set the delegate, or set the presentingController in your view controller

    • @tusharelangovan7302
      @tusharelangovan7302 4 ปีที่แล้ว

      @@iOSAcademy how do I set the presenting view controller

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

    I get zsh: command not found: pod

    • @iOSAcademy
      @iOSAcademy  4 ปีที่แล้ว

      You need to install pods

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

    you so good

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

      Thanks! Glad you like the videos :)

    • @younesidrissi2427
      @younesidrissi2427 4 ปีที่แล้ว

      @@iOSAcademyi like it

  • @anandsunku
    @anandsunku 4 ปีที่แล้ว

    can we get the mobile number associated with the google login ?

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

      Yes, its off the user object

    • @anandsunku
      @anandsunku 4 ปีที่แล้ว

      iOS Academy how to retain sign in after restarting the app. Like for the scene delegate routing .. in checking for current user and it says nil... any specific thing need to be done

  • @berkaygurcan141
    @berkaygurcan141 4 ปีที่แล้ว

    can you create new without firebase google log in version tutorial series ?

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

      Sure, added to my list :)

    • @berkaygurcan141
      @berkaygurcan141 4 ปีที่แล้ว

      @@iOSAcademy thank you :)

    • @berkaygurcan141
      @berkaygurcan141 4 ปีที่แล้ว

      @@iOSAcademy And ı have a one question for you :). What is mean 'silent sign in' me 2 don't found in auto comp. I wanted to ask what it does

  • @victorriurean
    @victorriurean 2 ปีที่แล้ว

    nice

  • @ioscasperon1719
    @ioscasperon1719 3 ปีที่แล้ว

    i am tried But showing blur screen after click google sign-in Button. What is the issue?? Kindly give reason