0.3.0 • Published 5 years ago
onfido-rn-sdk v0.3.0
onfido-rn-sdk
A react-native wrapper for the onfido-ios-sdk and onfido-android-sdk identity verification SDKs.
Installation
npm install onfido-rn-sdkUsage
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
Xcodeand add a blank.swiftfile 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
NSCameraUsageDescriptionandNSMicrophoneUsageDescriptionkeys in your application'sInfo.plistfile:
<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
jcenteryou will need to modify therepositoriesdirective in your application'sbuild.gradle:
repositories {
maven {
url "https://dl.bintray.com/onfido/maven"
}
}- Enable multidex by modifying the
defaultConfigin your applicationsandroid/app/build.gradle:
defaultConfig {
multiDexEnabled true
}License
MIT