搜索插件、代码仓与 APP 分类

插件详情v1.0.6

native_auth

此包用于实现 FaceID、TouchID 和指纹认证

AndroidiOSWindows
近 30 天下载
39
喜欢数
32
Pub 分数
150

安装插件

flutter pub add native_auth

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

原生认证是一个Flutter包,可在Android和iOS设备上使用Face ID、Touch ID和指纹识别实现生物识别认证。它提供了一个简单的接口,可将安全的本地认证集成到应用程序中,通过快速可靠的身份验证提升用户体验。该包还支持Windows,使其适用于跨平台应用。基于原生平台API构建,确保了兼容性和性能。开发者可以使用极少的代码轻松实现安全登录或敏感操作确认。源代码在GitHub上公开,以保证透明度并支持贡献。

适合场景

  • 安全应用登录
  • 基于生物特征的交易确认
  • 受保护的数据访问
  • 用户身份验证
  • 双因素认证

主要特点

  • 面容 ID 支持
  • 支持触控 ID
  • 指纹认证
  • 跨平台兼容性(Android、iOS、Windows)
  • 简单 API 集成

适合对象

  • 需要安全认证的应用程序
  • 金融或银行应用
  • 具有隐私需求的医疗保健应用程序
  • 处理敏感用户数据的应用程序
  • 开发安全的移动体验

使用建议

  • 需要设备支持生物识别
  • 仅限 Android、iOS 和 Windows 平台
  • 可能需要备用身份验证方法
  • 权限必须得到妥善处理
  • 不适用于非生物特征使用场景

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

native_auth

With this pack you can use the biometrics systems of Android and IOS devices.


It will ask for the user which the biometric authentication method of his device, this can be FaceID or TouchID on IPhone or FingerPrint on Android phone

How to use

import 'package:native_auth/native_auth.dart';
final response = await Auth.isAuthenticate();
print(response.isAuthenticated); // true or false

response is an enum AuthResult containing the statuses:

error, auth and noAuth

auth means the user is authenticated.
noAuth means the user is no authenticated.
error means that it was not possible to request any biometrics.

📱Screenshots

🤖 Android

🍎 IOS

IOS Integration

Update your project's Info.plist file to include the FaceID permissions:

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

Android Integration

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

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

Update your MainActivity.kt:

import io.flutter.embedding.android.FlutterFragmentActivity

class MainActivity: FlutterFragmentActivity() {
    // ...
}

OR

Update your MainActivity.java:

import io.flutter.embedding.android.FlutterFragmentActivity;

public class MainActivity extends FlutterFragmentActivity {
    // ...
}

to inherit FlutterActivity from FlutterFragmentActivity


Feito com ❤️ by Weliton Sousa

所属分类

依赖

依赖清单 3 项

  • local_auth^2.1.6
  • local_auth_android^1.0.21
  • local_auth_ios^1.1.1

源码仓库

使用此插件的项目

暂无相关数据。