Apple Sign In with Flutter & Firebase Authentication

Ғылым және технология

📖 Full reference article with step-by-step instructions: 👇👇
codewithandrea.com/videos/202...
This tutorial shows how to implement Apple Sign In with Flutter & Firebase Authentication (from scratch), and give your iOS users a convenient way of signing into your app.
HIGHLIGHTS
00:00 - Intro
01:23 - Project Setup (Firebase + Xcode)
04:15 - Code overview
04:50 - Checking if Apple Sign In is available
06:07 - UI Overview
06:50 - Authentication code
08:28 - Putting things together
Full source code: github.com/bizz84/apple_sign_...
Want more? Check out all my Flutter courses: 👇👇
codewithandrea.com/courses/
Thanks for watching!

Пікірлер: 33

  • @mertmusaoglu211
    @mertmusaoglu2114 жыл бұрын

    Very useful Awesome explanation thank you Andrea

  • @bhawnasaroha2949
    @bhawnasaroha29493 жыл бұрын

    Thanks a lot for the video. I have one question though. How can delete user functionality be implemented with Apple ID?

  • @codewithsyahrin
    @codewithsyahrin3 жыл бұрын

    Thanks for the video.

  • @rezaramadhan4237
    @rezaramadhan42373 жыл бұрын

    Thanks bro, you saved my life

  • @codeakblack1265
    @codeakblack12654 жыл бұрын

    Hi Andrea, Love your content currently taking your flutter course. When I attempt to add my personal team in Xcode I get the following errors "Your development team, XXX does not support the Sign In with Apple capability" & "No profile for com.name.timeApp were found" I've tried to search online but don't understand how to fix these errors could you please help?

  • @fisherman16131113
    @fisherman161311134 жыл бұрын

    Hi thank you for the video ! I have a question Every time I implement Apple SingIn method Dialog comes up and say "Create an account for ~~~~~Your app name~~~~" I dont like it ONCE you have already done apple signIn From second time I want dialog saying "SignIn with Apple " NOT like "Create an account" Its weird to say "create an account " every time users try to sign in, isnt it ? how can i do that ??

  • @nils.reichardt
    @nils.reichardt4 жыл бұрын

    Thanks!

  • @SanketShahidar
    @SanketShahidar4 жыл бұрын

    I am getting "flutter: error PlatformException(ERROR_INVALID_CREDENTIAL, The audience in ID Token [abc.def.app] does not match the expected audience abc.def.app., null)". Thanks for the helpful videos all the time...

  • @ercuesy
    @ercuesy4 жыл бұрын

    Hi Andrea! Thanks for the video, it compliments nicely your Time Tracker app course. I'm busy with an app that uses most, if not all, the code of the Time Tracker app for login and I've added this new functionality. I followed all the configuration steps but I'm getting Xcode build errors like null pointers and other stuff. On the Dart side all looks ok during build. One of the Xcode errors is about rawNonce and I read somewhere that a nonce (whatever that is) needs to be configured. Any ideas on that? Thanks!

  • @ercuesy

    @ercuesy

    4 жыл бұрын

    Never mind... pod update solved it but there were other intricacies regarding Apple development certificates and keychain access. I would love another tutorial from you to understand where all this fits in and under what circumstances it's required. Ciao!

  • @soufianeaouri6205
    @soufianeaouri62053 жыл бұрын

    How can we handle error 1000 on emulators please ?

  • @Fluttydev
    @Fluttydev4 жыл бұрын

    When i try to get email it return a null

  • @adlidetstudios7889

    @adlidetstudios7889

    3 жыл бұрын

    Any fix? The Apple credentials have the informations, but the Firebase User not. Update this value at the Firebase User leads to an Exception, when this E-Mail is existing in the Auth (e.g. Google Sign-In with same gmail) at another position. Apple Sign-In and update E-Mail with Apple credentials works, when there is not another user with the same E-Mail. But when then someone make a Google Sign-In with this E-Mail, Firebase is automatically deleting the Apple account. The same User-ID will be used in this case for the gmail-account.

  • @agung_laksana
    @agung_laksana2 жыл бұрын

    Unfortunately the apple_sign_in package is no longer maintained. Really appreciate all videos you have made, Andrea. But if you don't mind, please consider to update/make a new video about Apple Sign in in Flutter with latest package (sign_in_with_apple) since I can't find video tutorial about it on the internet. once again, thank you very much

  • @prashants6058

    @prashants6058

    2 жыл бұрын

    try "the_apple_sign_in"

  • @iMajeed95
    @iMajeed954 жыл бұрын

    Hey, thanks for the video its help a lot, I've one question if you don't mind. I'm trying to do one account per device, if the user uses another device it will be forced logout from the old device. What I understand i shouls use device_info library to get device id and store it in firebase and then if the user login it will compare device id with the one stored in firestore, I'm having a trouble in force logout.. So it will show a dialog to let the user decide if he want to logout from old device if he said yes it will, the question is how can I programmatically do that, with thanks.

  • @CodeWithAndrea

    @CodeWithAndrea

    4 жыл бұрын

    To my knowledge, this is not something that is possible or easy to do with the client Firebase SDK. Instead, it may be doable with the Firebase admin SDK. See this page: firebase.google.com/docs/auth/admin/manage-sessions You could try to write a cloud function to revoke the auth token for the desired uid, and see if the admin SDK supports doing this on a specific device.

  • @ercuesy
    @ercuesy4 жыл бұрын

    Andrea, there is a big problem Please implement Google SIgn-In alongside with your Apple Sign-in code and login with Google first. Your display name and url photo will be returned fine by Firebase. Then login with Apple and see what happens. If you go to the Firebase Authentication page and see the users tab you'll see the same gmail identifier with two providers Google and Apple. Then if you try to login with Google again your display name and photo url will be null. If you remove the Firebase user you can start the process again. Somehow Apple sign-in is messing Firebase Google's credentials. I hope you can reproduce it. Grazie.

  • @briannapaul634
    @briannapaul6344 жыл бұрын

    Hi there - Thanks for the video intro on Apple Sign in. Just want to know why your solution isolates any platform other than iOS from using the Apple Sign In ? Is there any specific reason why you decided to architect the solution with this constraint ?

  • @CodeWithAndrea

    @CodeWithAndrea

    4 жыл бұрын

    paul baker the plugin only supports iOS

  • @briannapaul634

    @briannapaul634

    4 жыл бұрын

    Yep. Understand that, hence the reason why I queried why your solution would only present an iOS based architecture when OAUTH & simple webflow login would cater for much wider platform audience and thus allow Apple-Sign-in to work on Android also and non iOS 13 devices.

  • @CodeWithAndrea

    @CodeWithAndrea

    4 жыл бұрын

    This was a short tutorial. I don’t see Apple sign-in being adopted much outside Apple platforms, as few developers would pay the $100 fee for the Apple developer membership, just to get Apple sign-in.

  • @briannapaul634

    @briannapaul634

    4 жыл бұрын

    $100 per year is not for AppleSignIn but for releasing to the AppStore & having the ability to create iOS apps. Flutter is X-Platform. This means its pointless using Flutter if you only intend to release to Android. Consequently if you are releasing to both platforms and your app has social provider authentication you have no choice but to support Apple Sign-in since Apple will reject all submissions otherwise.

  • @CodeWithAndrea

    @CodeWithAndrea

    4 жыл бұрын

    @@briannapaul634 You need an Apple Developer Account to release iOS apps. You need to use Apple Sign-in if your iOS app has other social logins. This is a non problem on the other mayor mobile platform (Android), where 100% of users have a Google account.

  • @easazade
    @easazade4 жыл бұрын

    hey man i need a suggestion. what library do you recommend for creating AR apps which works on all mobile phones and all android versions (at least android 6 and above). since google ARCore just works on some android devices. if the library doesn't work on IOS it would be fine for me?

  • @CodeWithAndrea

    @CodeWithAndrea

    4 жыл бұрын

    I don't know. I never done any AR work.

  • @ChristianGarcia-mc9hw
    @ChristianGarcia-mc9hw4 жыл бұрын

    does it work on android?

  • @CodeWithAndrea

    @CodeWithAndrea

    4 жыл бұрын

    No. The underlying API is for iOS only. There is a Javascript API for web. You may be able to use that on Android, but there's no Dart plugin for it.

  • @mauricioperezmoggle
    @mauricioperezmoggle Жыл бұрын

    good video, but after you type the password for the apple id it hungs there not doing anything , it never gets here final userCredential = await _firebaseAuth.signInWithCredential(credential); I m using an emulator, is that the cause of not continuing?

  • @keanallen

    @keanallen

    Жыл бұрын

    Same iissue brother. Did u manage to fix it?

  • @Martial_Monkam
    @Martial_Monkam2 жыл бұрын

    Hello how to disconnect and return to the home page (SinPage). How to call SignInPage.create in another class to redirect the user to the home page ( SinPage ). here is the class with the function . static Widget create(BuildContext context) { final auth = Provider.of(context, listen: false); return ChangeNotifierProvider( create: (_) => ValueNotifier(false), child: Consumer( builder: (_, isLoading, __) => Provider( create: (_) => SignInManager(auth: auth, isLoading: isLoading), child: Consumer( builder: (_, manager, __) => SignInPage(manager: manager, isLoading: isLoading.value), ), ), ), ); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////I would like to disconnect and be able to call it out of this class. Future _signOut(BuildContext context) async { try { final auth = Provider.of(context, listen: false); await auth.deconnexion(); } catch (e) { print(e.toString()); } ??????????????????????????????? Navigator.of(context).push(MaterialPageRoute(builder: (context) => Sinpage.create( )),); }

Келесі