onfido-rn-sdk
A react-native
wrapper for the onfido-ios-sdk
and onfido-android-sdk
identity verification SDKs.
Installation
npm install onfido-rn-sdk
Usage
Quick Start
import Onfido from 'onfido-rn-sdk';
const token = 'YOUR_SDK_TOKEN_HERE';
const options = {};
const successHandler = message => console.log(message);
const errorHandler = message => console.log(message);
Onfido.startSDK(token, options, successHandler, errorHandler);
Pre-Requisites
ios
-
Your project must have some swift code and a bridging header in order to correctly compile the SDK. If it does not, open
Xcode
and add a blank.swift
file and let it generate a bridging header for you. (TODO: see here) -
The Onfido SDK makes use of the device Camera. You will be required to have the
NSCameraUsageDescription
andNSMicrophoneUsageDescription
keys in your application'sInfo.plist
file:
<key>NSCameraUsageDescription</key>
<string>Required for document and facial capture</string>
<key>NSMicrophoneUsageDescription</key>
<string>Required for video capture</string>
Note: Both keys will be required for app submission.
Android
- Until the Onfido package is available in
jcenter
you will need to modify therepositories
directive in your application'sbuild.gradle
:
repositories {
maven {
url "https://dl.bintray.com/onfido/maven"
}
}
- Enable multidex by modifying the
defaultConfig
in your applicationsandroid/app/build.gradle
:
defaultConfig {
multiDexEnabled true
}
License
MIT