Welcome to Biometric_callback Plugin!

This Flutter plugin provides means to perform biometric authenticationo of the user.On supported devices, this includes authentication with biometrics such as fingerprint or facial recognition.Now It supports both for Android and iOS.

Android Permission

Update your project's AndroidManifest.xml file to include the USE_BIOMETRIC permissions:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  <uses-permission android:name="android.permission.USE_BIOMETRIC"/>

iOS Permission

Note that this plugin works with both Touch ID and Face ID. However, to use the latter, you need to also add:

<string>Why is my app authenticating using face id?</string>

Android Integration

Activity Changes

Note that Biometric_callback requires the use of a FragmentActivity instead of an Activity. To update your application:

Update your MainActivity.kt:

import androidx.annotation.NonNull
import io.flutter.embedding.android.FlutterFragmentActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugins.GeneratedPluginRegistrant

class MainActivity: FlutterFragmentActivity() {

    override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {




Device IOSPolicy deviceOwnerAuthenticationWithBiometrics owner will be authenticated using a biometric method (Touch ID or Face ID).

Using IOSPolicy deviceOwnerAuthentication Device owner will be authenticated by biometry or device passcode.


Device PinEnable false will be authenticated using only biometric method.

Using PinEnable true Device owner will be authenticated by biometry and after fail it will show device passcode/Pattern.


Keep in mind that this depends on the platform, as in iOS LocalAuthentication is not provided with any callbacks and you only receive the final result, locked out, and any specified error_code.We need an event-based system because Android provides callbacks.You can therefore receive every callback as a result.

final _biometricCallback = BiometricCallback();
  BiometricAuthResult? bioMetrciAuthResult;

  ///For android
  StreamSubscription<dynamic>? eventSubscription;

  void initState() {

  Future<void> biometricResult() async {
    if (Platform.isIOS) {
      try {
        bioMetrciAuthResult = await _biometricCallback.getBiometricAuthResult();
        debugPrint(bioMetrciAuthResult?.isSuccess.toString() ?? "");
      } catch (e) {
        debugPrint(" error : ${e.toString()}");
    } else {
      try {
        eventSubscription = _biometricCallback.getBiometricAuthEvent().listen(
          (event) async {
            // Handle the received event data
            final String eventName = event['event'];
            final dynamic eventData = event['data'];
            if (eventName == 'success') {
              bioMetrciAuthResult =
            } else if (eventName == 'error') {
              bioMetrciAuthResult =
            setState(() {});
          onError: (error) {
            // Handle any error during event reception
            debugPrint("flutter Errror :: $error");
          cancelOnError: true, // Cancel the subscription on error
      } catch (e) {
        debugPrint(" error : ${e.toString()}");

  void dispose() {