A Flutter plugin for iOS 13+ that enables you to use native "Sign in with Apple" functionality.
dependencies:
sign_in_with_apple_native: ^0.0.1
import 'package:sign_in_with_apple_native/sign_in_with_apple_native.dart';
In order to use Sign in with Apple, you need to add "Sign in with Apple" capability to your app. To do so, open your project in Xcode, select your project in the Project Navigator, select your target, and open the "Signing & Capabilities" tab. Click the "+ Capability" button, and select "Sign in with Apple" from the list.
Always returns true
as the plugin is only available on iOS 13+.
final isAvailable = await SignInWithAppleNative.isAvailable();
Uses ASAuthorizationAppleIDProvider.getCredentialState
to check the state of the credentials. This is a local, inexpensive, nonnetwork call enabled by the Apple ID system that keeps the Apple ID state on a device in sync with Apple servers.
final state = await SignInWithAppleNative.credentialState;
Uses ASAuthorizationController.performRequests
to request credentials from the user.
SignInWithAppleButton(
onPressed: () async {
final credential = await SignInWithAppleNative.authorize();
print(credential);
},
)
Use the identityToken
and authorizationCode
to verify the credentials on your server. See Verifying a User for more information.
See the example application source for a complete sample app using the Sign in with Apple button.
MIT