mfa 1.2.0 copy "mfa: ^1.2.0" to clipboard
mfa: ^1.2.0 copied to clipboard

PlatformAndroidiOS
unlisted

MFA

Hướng dẫn tích hợp #

SDK xác thực

Tính năng #

  • Xác thực khuôn mặt
  • Xác thực OTP

Cài đặt #

Flutter #

Thực hiện câu lệnh sau:

~ flutter pub add mfa
copied to clipboard

Câu lệnh này sẽ thêm vào pubspec.yaml dòng sau

dependencies:
  mfa: ^1.0.0
copied to clipboard

import #

import 'package:mfa/mfa.dart';

final _mfa = Mfa();
_mfa.faceCheck(
  debug, // require
  token, // require
  (result) {
    //callback
    print("Result: $result");
  },
);

_mfa.genToken(
  phone, // require
  cif, // require
  appId, // require
  transId, // require
  (result) {
    //callback
    print("ResponseKyc: $result");
  },
);

copied to clipboard

Mô tả các trường dữ liệu.

Tên biến Kiểu dữ liệu
debug bool
token string
phone string
cif string
appId string
transId string

Thư viện này được cung cấp giới hạn cho đối tác nhất định và cần cấu hình đặc thù riêng cho AndroidIOS, bạn cần làm theo các bước sau.

Android setup #

Yêu cầu

  • minSDK 24
  • Permission Camera, Storage, Audio, Biometric, Internet

Cấu hình manifest:

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
    <uses-permission android:name="android.permission.USE_BIOMETRIC"/>
    <uses-permission android:name="android.permission.CAMERA"/>
    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
    <uses-feature android:name="android.hardware.camera"/>
copied to clipboard

Cấu hình maven:

allprojects {
    repositories {
        maven { url "https://maven.google.com" }
        maven { url "https://jitpack.io" }
        maven {
            url = uri("https://maven.pkg.github.com/pvcbdigibank/SDK_MFA_ANDROID")
            credentials {
                username = ""
                password = "<Access Key>"
            }
        }
    }
}
copied to clipboard

<Access Key> được cung cấp riêng.

IOS setup #

⚠️ Request

  • Minimum iOS Deployment Target: 13.0 or newer
  • Xcode 15.3 or newer
  • Swift 5.10 or newer
  • Permissions: Camera, Face ID

Add information to the Info.plist file

You need add permissions: Camera, Face ID

[imagerm1]

<key>NSCameraUsageDescription</key>
<string>Camera permission</string>
<key>NSFaceIDUsageDescription</key>
<string>FaceID permission</string>
copied to clipboard

⚠️ Important note

If you compile the project and get the following errors:

  • Pods Alamofire, CryptoSwift, SnapKit, lottie-ios, KeychainSwift, ObjectMapper were not found
  • Related to IPHONEOS_DEPLOYMENT_TARGET
  • Swift version conflict

Please add the following content to your project's Podfile in post_install do |installer|

installer.pods_project.targets.each do |target|
  if ["Alamofire", "CryptoSwift", "SnapKit", "lottie-ios", "KeychainSwift", "ObjectMapper"].include? "#{target}"
    target.build_configurations.each do |config|
      config.build_settings["BUILD_LIBRARY_FOR_DISTRIBUTION"] = "YES"
    end
  end
  if ["Alamofire", "KeychainSwift", "ObjectMapper"].include? "#{target}"
    target.build_configurations.each do |config|
      deployment_target = config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"]
      if !deployment_target.nil? || !deployment_target.empty? || deployment_target.to_f < 12.0
        config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = "12.0" 
      end
    end
  end
end
copied to clipboard
1
likes
120
points
26
downloads

Publisher

unverified uploader

Weekly Downloads

2024.07.06 - 2025.01.18

MFA

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on mfa