Flutter Plugin for Sign In with Apple

Overview

Apple Sign In - Flutter Plugin

Access Sign In with Apple from Flutter.

Platform support

This plugin currently only supports iOS. There's a JavaScript framework for Android.

Implementing

  1. Configure your app in Xcode to add the "Sign In with Apple" capability
  2. See the example app to see how the API works

FAQs

User information is null after signing in

User details such as email and name are only provided the first time a user signs in to your app with Sign in With Apple. This isn't a limitation of the plugin, it's how the native SDK functions.

On signing in again, all the properties are null. You need to store them the first time you login.

For testing purposes you can revoke the credentials to sign in again:

  1. Sign in to https://appleid.apple.com/account/manage
  2. Go to "Apps & Websites Using Apple ID" and click "Manage"
  3. Select your app
  4. Click "Stop Using Apple ID"

I'm getting errors when trying to build the project

Sign In with Apple requires Xcode 11, as it requires the iOS 13 SDK. Make sure you're up-to-date.

To Do

  • Localisation for "Sign in with Flutter" button
  • A proper step-by-step example
  • Support for PasswordProvider
Comments
  • getCredentialState returned an error: The operation couldn’t be completed. (com.apple.AuthenticationServices.AuthorizationError error 1000.)

    getCredentialState returned an error: The operation couldn’t be completed. (com.apple.AuthenticationServices.AuthorizationError error 1000.)

    Hello guys,

    when I sign in into the example, close the App and restart it, I always getting this error code:

    2019-10-30 20:02:45.012873+0100 Runner[76206:1907400] [core] Credential State request returned with error: Error Domain=AKAuthenticationError Code=-7001 "(null)" 2019-10-30 20:02:45.107926+0100 Runner[76206:1907406] flutter: getCredentialState returned an error: The operation couldn’t be completed. (com.apple.AuthenticationServices.AuthorizationError error 1000.)

    `[✓] Flutter (Channel master, v1.10.15-pre.285, on Mac OS X 10.15 19A602, locale de-DE) • Flutter version 1.10.15-pre.285 at /Users/pedrolopes/Documents/workspace/flutter • Framework revision 38f2d27685 (2 hours ago), 2019-10-28 11:28:09 -0700 • Engine revision 869b74eb4e • Dart version 2.6.0 (build 2.6.0-dev.8.2 5b7c981086)

    [✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3) • Android SDK at /Users/pedrolopes/Library/Android/sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-28, build-tools 28.0.3 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06) • All Android licenses accepted.

    [✓] Xcode - develop for iOS and macOS (Xcode 11.0) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.0, Build version 11A420a • CocoaPods version 1.8.3

    [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

    [✓] Android Studio (version 3.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 31.3.1 • Dart plugin version 181.5656 • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

    [✓] VS Code (version 1.39.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.5.1 `

    @tomgilder Do you have any idea?

    opened by pedro371 25
  • Unhandled Exception: MissingPluginException on AppleSignIn.performRequests

    Unhandled Exception: MissingPluginException on AppleSignIn.performRequests

    I've followed the instructions and copied the button and handler code from the example into my app. When the code executes

    final AuthorizationResult result = await AppleSignIn.performRequests([
      AppleIdRequest(requestedScopes: [Scope.email, Scope.fullName])
    ]);
    

    I get the exception below.

    [VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: MissingPluginException(No implementation found for method performRequests on channel dev.gilder.tom/apple_sign_in)
    #0      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:314:7)
    <asynchronous suspension>
    #1      AppleSignIn.performRequests (package:apple_sign_in/apple_sign_in.dart:42:41)
    <asynchronous suspension>
    #2      _LoginScreenState.doLoginWithApple (package:ping/screens/loginScreen/Login.screen.dart:306:58)
    <asynchronous suspension>
    #3      _AppleSignInButtonState.build.<anonymous closure> (package:apple_sign_in/apple_sign_in_button.dart:54:17)
    #4      TapGestureRecognizer._checkUp.<anonymous closure> (package:flutter/src/gestures/tap.dart:363:49)
    #5      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
    #6      TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:363:11)
    #7      TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:275:7)
    #8      PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:455:9)
    #9      PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:75:13)
    #10     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:102:11)
    #11     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19)
    #12     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
    #13     GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
    #14     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
    #15     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
    #16     _rootRunUnary (dart:async/zone.dart:1136:13)
    #17     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
    #18     _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
    #19     _invoke1 (dart:ui/hooks.dart:263:10)
    #20     _dispatchPointerDataPacket (dart:ui/hooks.dart:172:5)
    

    Have I missed something obvious or is this an issue with the plugin?

    opened by Style87 14
  • After the first sign in , email and fullName becomes null

    After the first sign in , email and fullName becomes null

    Im trying to implement the apple sign in to deploy my app to the App Store but we found that after the first sign in , the object result.credential.email and fullName returns null, also the authorized scopes is always empy??

    Dont know how to proceed after this , any help is welcome

    First Authorization Next Authorizations

    opened by dacxjo 8
  • Stuck after password input

    Stuck after password input

    Hi. Thanks for the plugin. I have an issues including it into my project. I tried even on newly created flutter project but it does not work.

    Steps to reproduce:

    1. Create new flutter project with android studio
    2. Copy/paste the pubspec.yaml from example into new project
    3. Copy/paste the lib contents from example into new project
    4. Launch the new project in the debugger
    5. Try to login with apple id. The whole process runs smoothly
    6. On the last step when you enter the password the spinner appears in the password field and then nothing happens. No errors in console. No errors in XCode. Just silence.
    7. This could be fixed with copy/pasting the ios folder from example project into newly created. But this looks pretty hacky.

    Maybe I'm missing something in setup process?

    opened by vasilich6107 7
  • Authorization failed: Error Domain=AKAuthenticationError Code=-7026

    Authorization failed: Error Domain=AKAuthenticationError Code=-7026 "(null)" UserInfo=

    Error trying -> final AuthorizationResult result = await AppleSignIn.performRequests([ AppleIdRequest(requestedScopes: [Scope.email, Scope.fullName]) ]);

    2019-12-30 18:40:46.796195-0300 Runner[89962:599664] [core] Authorization failed: Error Domain=AKAuthenticationError Code=-7026 "(null)" UserInfo={AKClientBundleID=br.com.enterprise.vbbritodepaulo} 2019-12-30 18:40:46.826946-0300 Runner[89962:599596] flutter: The operation couldn’t be completed. (com.apple.AuthenticationServices.AuthorizationError error 1000.)

    question 
    opened by viniciuspaulo 6
  • Apple rejection

    Apple rejection

    Apple rejected our app for the following reason. They won't explain what the exact problem is.

    We noticed an issue in your app that contributes to a lower quality user experience than Apple users expect:

    • Your app uses Sign in with Apple as a login option but does not use Sign in with Apple button design, branding and/or user interface elements appropriately as described in the Sign in With Apple Human Interface Guidelines.

    Next Steps

    To resolve this issue, please revise your app to address all instances of this type of issue.

    Resources

    For information on improving and enhancing your app:

    • Watch the video The Ingredients of Great Apps to understand the basics of great apps.
    • Watch the video iPhone and iPad User Interface Design for practical design tips.
    • Watch iOS Development Videos to learn about programming and design tips.
    • Review the iOS Human Interface Guidelines and ensure that your app's interface and design adhere to these guidelines.

    Please see attached screenshot for details.

    Screenshot 2019-12-20 at 12 44 32 AM question 
    opened by paddykily 6
  • can't get the clickable action on the sign in with apple button in production release build.

    can't get the clickable action on the sign in with apple button in production release build.

    Hi, This was the problem, I was created an app with the help of flutter_apple_sign_in by integrating the apple sign in. all the debug builds are working properly. and the last time I was build the production release and trying to click the button, I can't get the clickable action on the sign in with apple button. plz hlp me

    opened by jerald-jacob 4
  • Cannot build app with fastlane and xcode

    Cannot build app with fastlane and xcode

    This issue is same as #22, but bit different.

    This is SDK version and Xcode version

    iPhoneOS13.2.sdk - iOS 13.2 (iphoneos13.2)
     
    Xcode 11.2.1
    
    スクリーンショット 2020-02-11 17 13 05

    Please help me!!!

    opened by A-Hama 4
  • How does one log out of Apple Sign In?

    How does one log out of Apple Sign In?

    I was able to use this medium post (https://medium.com/@karlwhiteprivate/flutter-firebase-sign-in-with-apple-c99967df142f) to login my user. How do I log out a user who has signed in with Apple Sign in?

    opened by davydany 3
  • PersonNameComponents and email are all null in AppleIdCredential when running on a live device

    PersonNameComponents and email are all null in AppleIdCredential when running on a live device

    When using Face ID login or ANY Authentication mechanism for an iPhone - AuthorizationResult contains ALL null fields. This includes CREDENTIAL.

    When we test on a simulator - we get values for CREDENTIAL, i.e email, fullname, familyName, givenName...

    Tested on live iPhone X and iPhone 11 Pro MAX device.

    opened by therealjohnsummer 3
  • Invalid Token received

    Invalid Token received

    Hi - I have successfully authenticated against Apple and get an AuthorizationStatus.authorized code.

    I now want to use the credentials to sign in with the apple ID with Firebase, i.e I have this enabled in Firebase console :

    image

    To do this I use the identifyToken returned in the result but when I try and use FirebaseAuth.signInWithCustomToken(appleToken) I get :

    image

    is there something I'm missing here ?

    opened by ssbaval 3
  • apple login is working fine in 14.4 but not working in 14.4.2

    apple login is working fine in 14.4 but not working in 14.4.2

    apple login is working fine in 14.4 but not working in 14.4.2

    it returns below log, and returns null on result.credential

    { credential = { authorizationCode = “<FlutterStandardTypedData: 0x2805df300>“; authorizedScopes = ( ); email = ““; fullName = { familyName = ““; givenName = ““; middleName = ““; namePrefix = ““; nameSuffix = ““; nickname = ““; }; identityToken = “<FlutterStandardTypedData: 0x2805df5c0>“; realUserStatus = 1; state = ““; user = “000272.e84b4ad5a0a44dffb902ce7be56021d1.0554”; }; credentialType = ASAuthorizationAppleIDCredential; status = authorized; }

    opened by Bharavi26 0
  • Hey, I have developed Null-Safety version of this module with Flutter 2.0 Support

    Hey, I have developed Null-Safety version of this module with Flutter 2.0 Support

    Hey, I have developed Null-Safety version of this module with Flutter 2.0 Support using this source code. Can i contribute code this project or is it fine if upload null-safety and most of the bug fixed version as separate package?

    opened by AathifMahir 7
  • After password verification nothing happens

    After password verification nothing happens

    Hi,

    Apple signing dialog pops, after entering valid password nothing happens (same dialog stays in place) After entering not valid password input window is cleared asking for new password.

    I am using it in another app and there it works. (olde flutter version)

    Any ideas why response not comming?

    Worth telling that it happens on emulator - did not try on device

    opened by vytautas-pranskunas- 1
  • Update ButtonStyle enum

    Update ButtonStyle enum

    ButtonStyle is already defined in the flutter/src/material/button_style.dart, so need to change the name of the ButtonStyle enum from apple_sign_in/apple_sign_in_button to any other.

    The name 'ButtonStyle' is defined in the libraries 'package:apple_sign_in/apple_sign_in_button.dart (via package:apple_sign_in/apple_sign_in.dart)' and 'package:flutter/src/material/button_style.dart (via package:flutter/material.dart)'.
    Try using 'as prefix' for one of the import directives, or hiding the name from all but one of the imports.
    

    Flutter Doctor Summary

    flutter_sample git:(develop) ✗ flutter doctor -v
    [✓] Flutter (Channel stable, 1.22.0, on Mac OS X 10.15.7 19H2, locale en-IN)
        • Flutter version 1.22.0 at /Users/vinothvino/Developer/flutter
        • Framework revision d408d302e2 (2 days ago), 2020-09-29 11:49:17 -0700
        • Engine revision 5babba6c4d
        • Dart version 2.10.0
    
     
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
        • Android SDK at /Users/vinothvino/Library/Android/sdk
        • Platform android-30, build-tools 30.0.2
        • ANDROID_HOME = /Users/vinothvino/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 12.0)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 12.0, Build version 12A7209
        • CocoaPods version 1.9.3
    
    [✓] Android Studio (version 4.0)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin version 39.0.3
        • Dart plugin version 191.8423
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    
    [✓] VS Code (version 1.49.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.15.0
    
     
    [✓] Connected device (1 available)            
        • iPhone 11 (mobile) • C7A5417C-90EC-4B43-9822-083A2D821BCE • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-0 (simulator)
    
    • No issues found!
    
    
    opened by vinothvino42 4
Owner
Tom Gilder
Tom Gilder
A Flutter plugin for allowing users to authenticate with native Android & iOS Facebook login SDKs.

flutter_facebook_login A Flutter plugin for using the native Facebook Login SDKs on Android and iOS. AndroidX support if you want to avoid AndroidX, u

Iiro Krankka 404 Nov 26, 2022
By using Flutter Local Auth users can authenticate with Fingerprint & Touch ID in Flutter.

Flutter Tutorial - Fingerprint & Touch ID - Local Auth By using Flutter Local Auth users can authenticate with Fingerprint & Touch ID in Flutter. Soci

Johannes Milke 37 Dec 15, 2022
Flutter Password Validator package helps you to validate user-entered passwords in your flutter app.

Flutter Password Validator Flutter Password Validator package helps you to validate sign-in user-entered passwords with your rules.

Aref Mozafari 26 Dec 14, 2022
Email and Password Authentication In Flutter & Firebase in Flutter 2.2

email_password_flutter_firebase Email and Password Authentication In Flutter & Firebase in Flutter 2.2 Overview This email and password authentication

null 0 Mar 24, 2022
A Flutter OAuth package for performing user authentication for your apps.

Flutter OAuth A Flutter OAuth package for performing user authentication for your apps. I've tested this with a small collection of APIs (Buffer, Stra

Joe Birch 173 Dec 9, 2022
The Simplest way to Authenticate in Flutter

Most apps need to make API calls. Every API needs authentication, yet no developer wants to deal with authentication. Simple Auth embeds authenticatio

James Clancey 340 Dec 25, 2022
A Flutter wrapper for AppAuth iOS and Android SDKs

flutter_appauth A Flutter plugin that provides a wrapper for native AppAuth SDKs (https://appauth.io) used authenticating and authorizing users. The r

Michael Bui 230 Dec 21, 2022
An OAuth authentication system built in Flutter using Google OAuth.

An OAuth authentication system built in Flutter using Google OAuth.

Kaushal 0 Sep 20, 2021
Flutter implementation of the Quickstart Supabase User Management app.

Supabase Flutter User Management This repo is a quick sample of how you can get started building apps using Flutter and Supabase. You can find a step

Supabase Community 56 Nov 14, 2022
This project is an example of Firebase authentication in a flutter

This project is an example of Firebase authentication in a flutter. This project shows how to implement a full authentication flow in Flutter, using sign Up with email and password, sign in with email and password, and reset password.

Nittin 4 Mar 11, 2022
WebView OAuth flows for desktop flutter apps

desktop_webview_auth A new flutter plugin project. Getting Started This project is a starting point for a Flutter plug-in package, a specialized packa

Invertase 22 Dec 17, 2022
Easy third party authentication (OAuth 2.0) for Flutter apps.

visa This is an OAuth 2.0 package that makes it super easy to add third party authentication to flutter apps. It has support for FB, Google, LinkedIn,

Emmanuel Olaojo 135 Dec 23, 2022
Authentication pages I made with Flutter and Firebase

Auth-with-Flutter-and-Firebase Authentication pages I made with Flutter and Firebase Overview This email and password authentication is implemented wi

Said Mirzayev 3 Jul 24, 2022
An example of JWT authentication with flutter.

flutter-jwt-auth-template An example of JWT authentication with flutter. Getting Started Clone this repository, and inside its folder, run: flutter pu

Enzo Di Tizio 23 Jan 4, 2023
In this Application Built Using Flutter🎯 along with FireBase 🔥for Managing the data

In this Application Built Using Flutter?? along with FireBase ??for Managing the data, I have Curated a simple?? Login/Sign Up Space along with Authentication!

Aashvi Kothari 4 Oct 9, 2022
7.Apple Shop UI - Apple Shop App UI Using Flutter

Apple Shop App Grid View Drawer Gradient Effect Objects

Tukhtamurodov Sardorbek 3 Feb 16, 2022
Flutter ShopApp, you can see products and their prices, categories and their products, search for a product, add to favorite, add to cart, sign in and sign up.

shop_app_2 A new Flutter application. Getting Started This project is a starting point for a Flutter application. A few resources to get you started i

Muhammed Rezk Rajab 10 Aug 7, 2022
Google one tap sign in - Flutter Google One Tap Sign In (Android)

Google One Tap Sign In Google One Tap Sign In (Android) A Flutter Plugin for Goo

null 6 Nov 23, 2022
Simple face recognition authentication (Sign up + Sign in) written in Flutter using Tensorflow Lite and Firebase ML vision library.

FaceNetAuthentication Simple face recognition authentication (Sign up + Sign in) written in Flutter using Tensorflow Lite and Google ML Kit library. S

Marcos Carlomagno 279 Jan 9, 2023
6.SignIn SignUp-UI - SIGN IN And SIGN UP UI For Flutter

SIGN IN & SIGN UP UI Text Fields Box Shadow Gradient resizeToAvoidBottomInset Ri

Tukhtamurodov Sardorbek 3 May 16, 2022