AppleProvider class

A Firebase UI Auth provider which should be used to add Apple Sign In to your app.

It is recommended to check if the current platform supports Apple Sign In. This could be achieved with device_info_plus package.

import 'package:firebase_ui_auth/firebase_ui_auth.dart';
import 'package:device_info_plus/device_info_plus.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();

  final deviceInfo = DeviceInfoPlugin();
  final iosInfo = await deviceInfo.iosInfo;

  FirebaseUIAuth.configureProviders([
    if ((double.tryParse(iosInfo.systemVersion) ?? 0) >= 13) AppleProvider(),
  ]);

  runApp(MyApp());
}

Constructors

AppleProvider({Set<String> scopes = const <String>{'email'}})

Properties

auth ↔ FirebaseAuth
The FirebaseAuth instance used to perform authentication against. By default, FirebaseAuth.instance is used.
getter/setter pairinherited
authListener ↔ OAuthListener
An instance of the AuthListener that is used to notify about the current state of the authentication process.
getter/setter pairinherited
defaultRedirectUri String
no setterinherited
desktopSignInArgs → ProviderArgs
no setter
firebaseAuthProvider ↔ AppleAuthProvider
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
providerId String
String identifer of the auth provider, for example: 'password', 'phone' or 'google.com'.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scopes Set<String>
The scopes that will be passed down to the fba.AppleAuthProvider.
final
shouldUpgradeAnonymous bool
Indicates whether the user should be upgraded and new credential should be linked.
no setterinherited
style → ThemedOAuthProviderButtonStyle
An object that is being used to resolve a style of the button.
final

Methods

desktopSignIn(AuthAction action) → void
Handles authentication logic on desktop platforms
findProvidersForEmail(String email, [AuthCredential? credential]) → void
Fetches available providers for the given email.
inherited
fromDesktopAuthResult(AuthResult result) → OAuthCredential
Creates OAuthCredential based on AuthResult.
linkWithCredential(OAuthCredential credential) → void
Links a provided AuthCredential with the currently signed in user account.
inherited
logOutProvider() Future<void>
mobileSignIn(AuthAction action) → void
Handles authentication logic on mobile platforms.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onCredentialReceived(OAuthCredential credential, AuthAction action) → void
A method that is called when the user has successfully completed the authentication process and decides what to do with the obtained credential.
inherited
platformSignIn(TargetPlatform platform, AuthAction action) → void
Redirects the flow to the mobileSignIn or desktopSignIn based on current platform.
inherited
signIn(TargetPlatform platform, AuthAction action) → void
inherited
signInWithCredential(OAuthCredential credential) → void
Signs the user in with the provided AuthCredential.
inherited
supportsPlatform(TargetPlatform platform) bool
Verifies that an AuthProvider is supported on a platform.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited