Skip to main content

Quick Start

The biometric capture SDK can be integrated in React Native apps by adding the NPM package to your project. The React Native library provides similar functionality as the native Android and iOS libraries.

Installation

  1. Use the following command to add the dependency to your package.json file:

    npm i @mobaibio/mobai-biometric
  2. Run the following command to install the dependency

    yarn

iOS

  1. The SDK needs to access the camera on the device. A NSCameraUsageDescription must be added to the Info.plist for your application.

  2. Some additions must be added to the podfile for the iOS project in order to integrate the SDK correctly.

    • If use_frameworks! :linkage => :static is used then the following must be added to the podfile to ensure dependency is built as a dynamic framework:

      pre_install do |installer|
      installer.pod_targets.each do |pod|
      if ['SwiftProtobuf'].include?(pod.name)
      def pod.dynamic_framework?;
      true
      end
      def pod.build_type;
      Pod::BuildType.dynamic_framework
      end
      end
      end
      end
    • A post install script to enable module stability in the SDK and its dependencies:

      post_install do |installer|
      installer.pods_project.targets.each do |target|
      if ['MobaiBiometric', 'SwiftProtobuf'].include? target.name
      target.build_configurations.each do |config|
      config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
      end
      end
      end

Android

The repository where the biometric capture SDK gradle package used by the React Native module is located must be added to the list of repositories.

// build.gradle (Project)
allprojects {
repositories {
maven {
url "https://gitlab.com/api/v4/projects/36441060/packages/maven"
}
}
}