React (iOS/Android)
The SDK provides a set of screens for capturing identity documents, face photos, and profile data, and for performing the liveness check.
The SDK does not provide methods for obtaining verification results. You can either use the API to pull the results or rely on webhooks from the GetID backoffice.
Getting started
This documentation contains an example of the integration of native GetID iOS and Android SDK into a React Native cross-platform application.
Obtaining an SDK key
To start using the Native SDK, you will need an SDK KEY
and API URL
.
Both can be provided by the Integration team.
Installation
Clone the project, navigate to the project directory and install node modules:
git clone https://github.com/vvorld/getid-react-native-example
cd getid-react-native-example
npm install
Use npm install --legacy-peer-deps
to use legacy dependencies as is
Open App.js
file and set apiUrl
and sdkKey
.
iOS
cd ios
pod install
Open ios/GetIDExample.workspace
in Xcode
and run the app or type npx react-native run-ios
in the root project directory.
Android
Open android
in Android Studio and run the app or npx react-native
start in one Terminal window and command npx react-native run-android
from root
folder in another.
Install GetID SDK from scratch
iOS
- Add pod 'GetID', 'X.Y.Z' to ios/Podfile.
- In ios folder run pod install.
- Add
NSPhotoLibraryUsageDescription, NSMicrophoneUsageDescription
andNSCameraUsageDescription
toios/YourProjectName/Info.plist
. See description examples in this repository. - Open the
.xcworkspace
file in Xcode. Select File > New > File > Swift File, name itGetIDSwiftWrapper
. When Xcode asks whether you want to add a bridging header file, confirm that you want to create it. - Select File > New > File > Cocoa Touch Class, subclass of NSObject, language Objective-C, name it RCTGetID.
- Copy the content of the
RCTGetID.h, RCTGetID.m
andGetIDSwiftWrapper.swift
from this repository to newly created files. Rename an import inRCTGetID.m
to#import "YourProjectName-Swift.h"
.
Android
- Add
jcenter()
toallprojects.repositories
inbuild.gradle
beforemavenCentral()
. - Add implementation
'ee.getid:getidlib:X.Y.Z'
toandroid/app/build.gradle
. The number of the latest version of GetID Android SDK can be found here. - Add implementation
'com.squareup.okhttp3:logging-interceptor:4.9.0'
toandroid/app/build.gradle
.
CopyGetID.java
file from this repository toandroid/app/src/main/java/com/yourprojectname
. - Copy
MyAppPackage.java
file from this repository toandroid/app/src/main/java/com/yourprojectname
. - Add
packages.add(new MyAppPackage());
inMainApplication.java
. See the exact place in this repository. - Remove
android:allowBackup="false"
fromAndroidManifest.xml
. - Copy the GetID activity to
AndroidManifest.xml
from this repository.
Common
In a .js
file, in the place you want to start the GetID verification flow, you have to call GetID.start(apiUrl, token, flowName);
. For example, see App.js
file in this repository.
Updated 9 months ago