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