iOS Firebase Authentication: Sign In With Apple Tutorial | Firebase Bootcamp #5

Поделиться
HTML-код
  • Опубликовано: 4 ноя 2024

Комментарии • 61

  • @andresraigoza2082
    @andresraigoza2082 Год назад +6

    This is awesome! Thank you so much for taking the time of cleaning up the code, this could be the trickiest part sometimes. I loved the way you implemented the completionHandler in SignInAppleHelper, it made me realize that closures are "Reference Type" in Swift 😮, I've been needing this so many times 😅. You definitely stand out compared with the other Swift RUclips Channels.

  • @karaokedeconstruction
    @karaokedeconstruction Год назад

    i miss the intro music but i'm glad you're back with videos

  • @georgekoukouris2347
    @georgekoukouris2347 10 месяцев назад

    Thanks a lot for this awesome tutorial! I've been following this playlist for a few videos now and this definitely went over my head at some points. Need to watch the concurrency playlist. Very helpful to see how you deal with problems and your way of debugging errors.

  • @30guarino
    @30guarino Год назад +5

    Holy Sh*t writing code to sign in with Apple was like we were hacking into the U.S Embassy lol....Great job!

    • @SwiftfulThinking
      @SwiftfulThinking  Год назад +1

      Haha yea it really is! I'm expecting Apple will update the API and I'll have to update this video eventually lol

    • @literallyshane4306
      @literallyshane4306 Год назад

      haha!

  • @SigmaPC94
    @SigmaPC94 Год назад +2

    Thanks Nick but why it has to be so complex when it comes to the iOS Signin ?

  • @leneil46
    @leneil46 Год назад +2

    Happy to see you back!!!!!!!🎉

  • @TonyLeung-e5u
    @TonyLeung-e5u Месяц назад

    You are legend! Great work👏

  • @konstantin7566
    @konstantin7566 7 месяцев назад

    This playlist is very cool. Thank you very much. I ran into a problem, memory leaks, as I understand it. It was worth logging in with Apple, so now the application doesn't even start and xcode writes that it starts consuming too much memory. As I understood it, this is a firebase problem, but the rollback to the old versions did not give any result, alas.

  • @reinaldof
    @reinaldof Год назад +2

    Thanks for sharing your high level knowledge, Nick.

  • @도레미파솔-g4r
    @도레미파솔-g4r Год назад +1

    does it matter further lectures if I don't implement appla login here? Well, I wanna pay apple dev account little more later :(

  • @nathandrake6722
    @nathandrake6722 Год назад +2

    You are a lifesaver that's all i'm saying and I haven't watched the video yet

  • @gregas3068
    @gregas3068 Год назад

    Hy. Is there really no simpler way to login with Apple to Firebase? I love your style, but this is really A LOT. So much going on here . . Thank you! And really grateful for the gists!!! Beautiful!

  • @kavinda_dilshan_paramsoodi
    @kavinda_dilshan_paramsoodi Год назад +1

    Thank you, Nick. Very helpful. I've never implemented Sign in with apple as I still don't have a paid developer account.😍 I will watch this again hopefully this year after getting my developer account.

  • @ZirohStory
    @ZirohStory Месяц назад

    Can Sign In be this complicated? Thanks to this, I learned a lot about swift. This frustrates me, but I have to make money by making apps. Thank you so much.

  • @aleixplanasguibas
    @aleixplanasguibas Год назад

    Awesome video! I followed the whole series and it's amazing! I just wanted to know how can I unwrap the name of the user in apple signin? I can't manage to get the name and set it to the DBUser or print it in any way. Any help? Thank you for your work!

  • @omerfarukozturk9720
    @omerfarukozturk9720 10 месяцев назад +1

    This is awesome! Great content

  • @vladimirmoor
    @vladimirmoor Год назад +1

    Fantastic work! Thanks a lot, Nick!

  • @jehanpoplife
    @jehanpoplife Год назад

    Thanks you so much, you are incredible, that helped me more than you could even think, great great work !

  • @NickGo
    @NickGo Год назад

    This is amazing. Thank you so much for all the details!

  • @mahoozi.97
    @mahoozi.97 8 месяцев назад

    25:31 I asked you regarding displaName on other tutorial, on this function I think should be used OAuthProvider.appleCredential rather than OAuthProvider.credential , but when I changed that I faced this error : Failed: Unable to parse the ID Token.

  • @tchendoh
    @tchendoh Год назад

    Great content! Everything but the sound is great. You need a better mic/sound setup. :)

    • @SwiftfulThinking
      @SwiftfulThinking  Год назад +2

      Haha yea I actually have a mic but I didn’t realize the fan on my computer was going off when recording, so I tried to edit the sound 😭😭😭 I’ve since bought a new MacBook M2 and it’s super quiet 😎

    • @tchendoh
      @tchendoh Год назад

      @@SwiftfulThinking ahah all right.

  • @labudsoft
    @labudsoft 6 месяцев назад

    Is there a way of doing this without using an UIKit? It seems to create as much trouble as it solves

    • @SwiftfulThinking
      @SwiftfulThinking  6 месяцев назад

      No unfortunately, there’s a SwiftUI way of implementing Apple SSO but it doesn’t work well with Firebase Auth. If they release an easier way, I will 100% replace this video with it

    • @labudsoft
      @labudsoft 6 месяцев назад

      @@SwiftfulThinking thank you for the reply, great video

  • @4bh1nav
    @4bh1nav Год назад

    Welcome back!

  • @davehall6001
    @davehall6001 5 месяцев назад

    great video but.....just too much for me to consume at this moment. Presentation is very confusing and it's gonna take me couple or triple times to watch this video to get it to work!

    • @Spacer-l3j
      @Spacer-l3j 4 месяца назад

      don't bother...There is alternatives for this on RUclips from Kavasoft. He has Sign in with Apple in a single view

  • @milanlabus1582
    @milanlabus1582 6 месяцев назад

    Is this code on Github?

  • @co-park
    @co-park Год назад

    Dude I love you

    • @SwiftfulThinking
      @SwiftfulThinking  Год назад

      ily2

    • @co-park
      @co-park Год назад

      @@SwiftfulThinking btw, think you could do a vid on persisting apple login for Apple+FirebaseAuth combo? I managed to do it, but doesn't feel right

    • @SwiftfulThinking
      @SwiftfulThinking  Год назад

      @@co-park Firebase automatically persists the authentication. If your UI is putting users back to the login screen, then it’s an issue with your UI code and not Firebase 🤔

    • @co-park
      @co-park Год назад

      @@SwiftfulThinking Are you saying I could do something like:
      var body: some View {
      switch Auth.auth().currentUser {
      case nil:
      LoginView()
      default:
      HomeView()
      }
      }
      And it would persist the user regardless of sign in method?
      If so, how long do these sessions persist.

  • @ІванФіліпчук-н8э

    do you have this code on github?

  • @FFHH-l9b
    @FFHH-l9b 2 месяца назад

    Your email is visible at 52:06

  • @magicsaviola
    @magicsaviola 11 месяцев назад

    Please sign in with facebook

  • @sourPollo
    @sourPollo Год назад

    no source code? :/

  • @mmendes6780
    @mmendes6780 Год назад

    So handsome

  • @cinquain0
    @cinquain0 Год назад +1

    Dude you are really nuking this. You’re making it way more complex than it needs to be. Your code is so complex it’s dumb

    • @Spacer-l3j
      @Spacer-l3j 4 месяца назад

      Imagine having a senior lead in your team with his mentality. God...his code is so complex and dumb i don't understand why

  • @mjboswell_
    @mjboswell_ Месяц назад

    Just a heads up: handling Apple's response has changed since the creation of this video (see line of code below). The provider is no longer required, and has been replaced by fullName, which is of type 'PersonNameComponents' 🥴
    let credential = OAuthProvider.appleCredential(withIDToken: idTokenString, rawNonce: nonce, fullName: appleIDCredential.fullName)

  • @jasapvideo4859
    @jasapvideo4859 Год назад

    I ran into a problem when trying to add Sign in With Apple capabilities under signing & capabilities on Xcode. I have also added capability under my app developer profile on the website as well. Have gotten certificates for everything else I needed but am still getting errors for “missing Sign in with Apple” and “missing com.apple.developer.applesignin entitlement.

  • @Kuraudo_VII
    @Kuraudo_VII Год назад +3

    I don't understand why you are making this so complicated by going at such a length to recreate the whole flow that the SwiftUI Apple Sign In Button provides...?
    import SwiftUI
    import AuthenticationServices
    import FirebaseAuth
    struct Logins: View {
    @State var currentNonce = ""
    var body: some View {
    VStack {
    SignInWithAppleButton { request in
    let nonce = randomNonceString() //Use a function to generate nonce
    currentNonce = nonce
    request.requestedScopes = [.email, .fullName]
    request.nonce = sha256(nonce) //Use a function to SHA256 encrypt
    } onCompletion: { result in
    handleAppleSignIn(with: result)
    }
    .frame(height: 40)
    .cornerRadius(8)
    }
    }
    func handleAppleSignIn(with result: Result) {
    switch result {
    case .success(let auth):
    switch auth.credential {
    case let credential as ASAuthorizationAppleIDCredential:
    guard let appleIDToken = credential.identityToken else { return }
    guard let idTokenString = String(data: appleIDToken, encoding: .utf8) else { return }
    // Initialize a Firebase credential, including the user's full name.
    let credential = OAuthProvider.appleCredential(
    withIDToken: idTokenString,
    rawNonce: currentNonce,
    fullName: credential.fullName
    )
    // Sign in with Firebase.
    Auth.auth().signIn(with: credential) { result, error in
    if let error = error {
    print(error.localizedDescription)
    return
    }
    // User is signed in to Firebase with Apple.
    // Continue with your logic
    }
    default:
    print("Error in retrieving auth info")
    }
    case .failure(let error):
    print("Sign in with Apple failed: \(error.localizedDescription)")
    }
    }
    }
    You can also extract currentNonce and the handleAppleSignIn function into a ModelData Object and pass it through as a environmentObject keep things cleaner.

    • @Septix
      @Septix 9 месяцев назад +1

      Cannot thank you enough, saved me an hour. Did a few tweaks and its working like charm 15.2

    • @Spacer-l3j
      @Spacer-l3j 4 месяца назад +1

      Brilliant... this is not the only video that he made it very complicated. Sometimes he is very dumb and i don't know why

    • @pigreatlor
      @pigreatlor 3 месяца назад

      is this the entire code you used for the apple sign in model?

    • @Kuraudo_VII
      @Kuraudo_VII 3 месяца назад

      @@pigreatlor pretty much. But that was a while ago. Are you running into any issues?

    • @pigreatlor
      @pigreatlor 3 месяца назад +1

      @@Kuraudo_VII no not yet, ive been looking at the tutorial but at the end i didnt understand all of it. yours seems very short hehe will try it in the next few days. if i run into problems i'll comment here again if you dont mind

  • @PavloMoroz-p9w
    @PavloMoroz-p9w Год назад

    func signInApple() async throws {
    let signInAppleResultsTokens = try await signInAppleHelper.startSignInWithAppleFlow()
    let authDataResult = try await self.authenticationManager.signInWithApple(tokens: signInAppleResultsTokens)
    let user = DatabaseUser(auth: authDataResult)
    try userManager.createNewUser(user: user)
    }
    When we tap to signInApple we create "updating" our DB for currect document. It's wrong?