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

  1. Add pod 'GetID', 'X.Y.Z' to ios/Podfile.
  2. In ios folder run pod install.
  3. Add NSPhotoLibraryUsageDescription, NSMicrophoneUsageDescription and NSCameraUsageDescription to ios/YourProjectName/Info.plist. See description examples in this repository.
  4. Open the .xcworkspace file in Xcode. Select File > New > File > Swift File, name it GetIDSwiftWrapper. When Xcode asks whether you want to add a bridging header file, confirm that you want to create it.
  5. Select File > New > File > Cocoa Touch Class, subclass of NSObject, language Objective-C, name it RCTGetID.
  6. Copy the content of theRCTGetID.h, RCTGetID.m and GetIDSwiftWrapper.swift from this repository to newly created files. Rename an import in RCTGetID.m to #import "YourProjectName-Swift.h".

Android

  1. Add jcenter() to allprojects.repositories in build.gradle before mavenCentral().
  2. Add implementation 'ee.getid:getidlib:X.Y.Z' to android/app/build.gradle. The number of the latest version of GetID Android SDK can be found here.
  3. Add implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0' to android/app/build.gradle.
    Copy GetID.java file from this repository to android/app/src/main/java/com/yourprojectname.
  4. Copy MyAppPackage.java file from this repository to android/app/src/main/java/com/yourprojectname.
  5. Add packages.add(new MyAppPackage()); in MainApplication.java . See the exact place in this repository.
  6. Remove android:allowBackup="false" from AndroidManifest.xml.
  7. 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.