React Native

Requirements

Installation of the Authenteq Flow npm requires React Native v0.61.5.

Getting started

$ npm install react-native-authenteq-flow --save

or

$ yarn add react-native-authenteq-flow

iOS setup

Update Podfile in your_project_dir/ios folder

  1. change minimum iOS deployment target to 10.0 or later

  2. add dynamic frameworks support

  3. add custom podspec repo url

  4. add workaround for Flipper framework usage (only if you plan to use Flipper framework). We recommend not to use Flipper and remove mentions of it from Podfile and AppDelegate.m files

platform :ios, '10.0'
source 'https://bitbucket.org/authenteq/cocoapods-specs.git'
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!
# Following code is required only when you are using Flipper
# If you don't plan to use Flipper, you can remove this part
$static_framework = ['CocoaAsyncSocket', 'CocoaLibEvent', 'OpenSSL-Universal', 'Flipper-Folly', 'FlipperKit', 'Flipper', 'Flipper-DoubleConversion', 'Flipper-Glog', 'Flipper-PeerTalk', 'Flipper-RSocket']
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
installer.pod_targets.each do |pod|
if $static_framework.include?(pod.name)
puts "Overriding the static_framework method for #{pod.name}"
def pod.build_type;
Pod::BuildType.static_library
end
end
end
end
# end
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
... other content of Podfile ...

Apply changes in Podfile

Run pod install command in your_project_dir/ios folder

Android setup

In your build.gradle add Authenteq maven repository to repositories list:

repositories {
maven {
url 'https://repo.app.authenteq.com/repository/maven-hosted'
}
}

▸ Set min Android SDK to level 21 (Android 5.0) in build.gradle

minSdkVersion 21

▸ Adjust backup settings in AndroidManifest.xml by changing the allowBackup attribute to true

android:allowBackup="true"

or disable it by adding this attribute in application tag

tools:replace="android:allowBackup"

this also requires you to add the following attribute in manifest tag

xmlns:tools="http://schemas.android.com/tools"

Usage in JavaScript

Import AuthenteqFlow in JS file before usage:

import AuthenteqFlow from 'react-native-authenteq-flow';

Start identification:

AuthenteqFlow
.identification("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET", [['PP','DL','NID']])
.then((res) => {
console.log(res);
}).catch((error) => {
console.error(error);
})

Example project

Example of JSON output for single document (driver's license)

{
"verificationId": "3EF7784D-CBBB-4737-98F9-322E895EC667",
"selfieImageFilePath": "path/to/jpeg_file",
"documents": [
{
"dateOfBirth": "1987-01-12",
"dateOfExpiry": "2045-05-22",
"dateOfIssue": "2015-05-22",
"documentFrontImageFilePath": "path/to/jpeg_file",
"documentBackImageFilePath": "path/to/jpeg_file",
"documentNumber": "DXY191672",
"documentType": "DL",
"givenNames": "ANNA MARIA",
"surname": "SCHMIDT",
"surnameAndGivenNames": "SCHMIDT ANNA MARIA",
"isEighteenPlus": true,
"isSixteenPlus": true,
"issuingCountry": "DEU",
"isTwentyOnePlus": true,
"licenseClass": "A1 A B1 B",
"licenseClassDetails": {
"A": {
"from": "2015-05-22"
},
"A1": {
"from": "2015-05-22"
},
"B": {
"from": "2004-08-27"
},
"B1": {
"from": "2004-08-27"
}
}
}
]
}

Example of JSON output for multiple documents (passport and driver's license)

{
"verificationId": "3EF7784D-CBBB-4737-98F9-322E895EC667",
"selfieImageFilePath": "path/to/jpeg_file",
"documents": [
{
"dateOfBirth": "1987-01-12",
"dateOfExpiry": "2027-01-30",
"documentFrontImageFilePath": "path/to/jpg_file",
"documentNumber": "8136431812",
"documentType": "PP",
"givenNames": "ANNA MARIA",
"surname": "SCHMIDT",
"surnameAndGivenNames": "SCHMIDT ANNA MARIA",
"isEighteenPlus": true,
"isSixteenPlus": true,
"issuingCountry": "DEU",
"isTwentyOnePlus": true,
"nationality": "DEU",
"sex": "F"
},
{
"dateOfBirth": "1987-01-12",
"dateOfExpiry": "2045-05-22",
"dateOfIssue": "2015-05-22",
"documentFrontImageFilePath": "path/to/jpeg_file",
"documentBackImageFilePath": "path/to/jpeg_file",
"documentNumber": "DXY191672",
"documentType": "DL",
"givenNames": "ANNA MARIA",
"surname": "SCHMIDT",
"surnameAndGivenNames": "SCHMIDT ANNA MARIA",
"isEighteenPlus": true,
"isSixteenPlus": true,
"issuingCountry": "DEU",
"isTwentyOnePlus": true,
"licenseClass": "A1 A B1 B",
"licenseClassDetails": {
"A": {
"from": "2015-05-22"
},
"A1": {
"from": "2015-05-22"
},
"B": {
"from": "2004-08-27"
},
"B1": {
"from": "2004-08-27"
}
}
}
]
}

Deprecated fields

selfieImageFile is deprecated and is now available as selfieImageFilePath

documentFrontFile is deprecated and is now available as documentFrontImageFilePath

documentBackFile is deprecated and is now available as documentBackImageFilePath