FLUTTER ECOSYSTEM

welitonsousa/native_auth

Com este pacote, você pode usar os sistemas biométricos de dispositivos Android e iOS.

Capa do projeto native_auth
Stars
8
Forks
3
Último push (UTC)
12 de abr. de 2023
Status do projeto
Ativo
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í
LinguagensDartSwiftKotlinObjective-C

Tópicos técnicos

Pacotes publicados por este repositório

Dependências usadas

Lista de dependências 6 itens
  • local_auth^2.1.6
  • local_auth_ios^1.1.1
  • local_auth_android^1.0.21
  • flutter{"sdk":"flutter"}
  • flutter_testDesenvolvimento{"sdk":"flutter"}
  • flutter_lintsDesenvolvimento^2.0.0

README original

Texto original em inglês. Visite o GitHub para a versão atual.

Expandir / recolher 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