FLUTTER ECOSYSTEM

welitonsousa/native_auth

使用此包,您可以使用 Android 和 iOS 设备的生物识别系统。

native_auth 项目封面
Stars
8
Forks
3
最近推送(UTC)
2023年4月12日
项目状态
未归档
Weliton Sousa GitHub avatar
GITHUB User

Weliton Sousa ↗

Sou desenvolvedor apaixonado por descobrir novas tecnologias. Gosto principalmente do desenvolvimento mobile, mas as tecs web e backend estão em dia 😉

FastzapPicos Piauí
语言DartSwiftKotlinObjective-C

技术话题

此仓库发布的插件

使用的依赖

依赖清单 6 项
  • local_auth^2.1.6
  • local_auth_ios^1.1.1
  • local_auth_android^1.0.21
  • flutter{"sdk":"flutter"}
  • flutter_test开发依赖{"sdk":"flutter"}
  • flutter_lints开发依赖^2.0.0

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

展开 / 收起项目 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

https://gitlab.com/welitonsousa/images/-/raw/main/android-waiting.png https://gitlab.com/welitonsousa/images/-/raw/main/android-success.png

🍎 IOS

https://gitlab.com/welitonsousa/images/-/raw/main/ios-waiting.png https://gitlab.com/welitonsousa/images/-/raw/main/ios-success.png

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