|
1 |
| -# Document Verification Android SDK |
| 1 | +# Predictive DocV Android SDK v3 |
2 | 2 |
|
3 |
| -The Document Verification Android SDK provides a framework to add image capture and upload services to your native Android applications. The SDK supports image capture for both Android and iOS. This guide covers only Android. |
| 3 | +The Predictive Document Verification (Predictive DocV) Android SDK v3 provides a framework to add image capture and upload services to your mobile application. |
4 | 4 |
|
5 | 5 | ## Minimum Requirements
|
6 | 6 |
|
7 |
| -| Feature | Minimum Requirements | |
8 |
| -|----------------------------------|----------------------| |
9 |
| -| Android SDK | `minSdkVersion 22` | |
10 |
| -| Document and Selfie Auto Capture | Android 8 and above | |
| 7 | +- Android SDK Version 22 (OS Version 5.1) and later |
| 8 | +- Android SDK is compiled with `compileSdkVersion 32` and Java 11 |
11 | 9 |
|
12 |
| -### OkHttp3 and Retrofit dependencies |
13 |
| - |
14 |
| -| Feature | Version | |
15 |
| -|----------|---------| |
16 |
| -| okHttp | 4.9.3 | |
17 |
| -| retrofit | 2.9.0 | |
| 10 | +## Configuration and integration |
18 | 11 |
|
| 12 | +The Predictive DocV Android SDK v3 allows integration as simple as writing a single line of code: |
19 | 13 | ```
|
20 |
| -def retrofitVersion = '2.9.0' |
21 |
| -implementation "com.squareup.retrofit2:retrofit:$retrofitVersion" |
22 |
| -implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion" |
23 |
| -
|
24 |
| -def okHttpVersion = '4.9.3' |
25 |
| -implementation "com.squareup.okhttp3:okhttp:$okHttpVersion" |
26 |
| -implementation "com.squareup.okhttp3:logging-interceptor:$okHttpVersion" |
| 14 | +SocureDocVHelper.getIntent(context, socure-api-key, config) |
27 | 15 | ```
|
28 | 16 |
|
29 |
| -## Installation |
| 17 | +| Argument | Description | |
| 18 | +| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 19 | +| `SocureDocVHelper` | A framework helper class. | |
| 20 | +| `socure-api-key` | The unique SDK key obtained from Admin Dashboard. For more information on SDK keys, see the Admin Dashboard User Guide. | |
| 21 | +| `context` | Activity context | |
| 22 | +| `config` | An optional JSON string or null value that specifies a custom flow. The `flow_1` value specifies the name of the flow (created in Admin Dashboard) that the Predictive DocV SDK should use. <br /> <br />`{"flow": {"name": "flow_1"}}` <br /> <br />If the value is `null`, the Predictive DocV SDK will fetch Socure's default flow. | |
30 | 23 |
|
31 |
| -To install the DocV Android SDK, you must perform the following steps: |
32 |
| - - [Add Socure to the build.gradle](#add-socure-to-the-buildgradle) |
33 |
| - - [Update permissions](#update-permissions) |
34 |
| - - [Add API keys](#add-api-keys) |
| 24 | +Before you can use the Predictive DocV Android SDK v3, you must perform the following steps: |
35 | 25 |
|
36 |
| -### Add Socure to the build.gradle |
| 26 | +- [Add SDK dependencies](#add-sdk-dependencies) |
| 27 | +- [Camera permissions](#camera-permissions) |
| 28 | +- [Launch Socure DocV SDK](#launch-socure-docv-sdk) |
37 | 29 |
|
38 |
| -You must add the following to your `build.gradle`: |
| 30 | +### Add SDK dependencies |
39 | 31 |
|
40 |
| -- Add the maven URL in the root/project level `build.gradle`: |
| 32 | +In your root `build.gradle` file, at the end of the `allprojects` > `repositories` section, add the Socure DocV SDK Maven repository. |
41 | 33 |
|
| 34 | +```kotlin {4} |
| 35 | +allprojects { |
| 36 | + repositories { |
| 37 | + ... |
| 38 | + maven { url 'https://jitpack.io' } |
| 39 | + } |
| 40 | + } |
42 | 41 | ```
|
43 |
| -(NOT IN THE `buildscript` code block above. allprojects is a sibling to build script) |
44 | 42 |
|
| 43 | +In your module level `build.gradle` file, add the following Socure DocV SDK dependency: |
45 | 44 |
|
46 |
| -allprojects { |
47 |
| - repositories { |
48 |
| - ....... |
49 |
| -
|
50 |
| - maven { |
51 |
| - url "https://jitpack.io" |
52 |
| - } |
53 |
| - } |
54 |
| -} |
55 |
| -``` |
| 45 | +```kotlin {2} |
| 46 | + dependencies { |
| 47 | + implementation 'com.github.socure-inc:socure-docv:x.y.z' |
| 48 | + } |
| 49 | + ``` |
56 | 50 |
|
57 |
| -- Add the following to the `build.gradle` of the module/library that uses the framework: |
| 51 | +### Camera permissions |
58 | 52 |
|
59 |
| -``` |
60 |
| -dependencies { |
61 |
| - implementation 'com.github.socure-inc:android-sdk:2.0.13' |
62 |
| -} |
63 |
| -``` |
| 53 | +The Predictive DocV Android SDK requires camera permission to capture identity documents. Upon the first invocation of the SDK, your app will request camera permission from the user. |
64 | 54 |
|
65 |
| -### Update permissions |
| 55 | +**Note**: We recommend you check for camera permissions before calling the Socure DocV SDK’s launch API. |
66 | 56 |
|
67 |
| -Make the following permission updates for Android in the Android.manifest: |
| 57 | +#### Required permissions |
| 58 | + |
| 59 | +Ensure that your app manifest has been set up properly to request the following required permissions: |
68 | 60 |
|
69 | 61 | ```
|
70 |
| -<uses-permission android:name="android.permission.CAMERA"></uses-permission> |
71 |
| -<uses-permission android:name="android.permission.INTERNET"></uses-permission> |
72 |
| -<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission> |
73 |
| -<uses-feature android:name="android.hardware.camera.autofocus" /> |
74 |
| -<uses-feature android:name="android.hardware.camera.flash" android:required="false" /> |
75 | 62 | <uses-feature android:name="android.hardware.camera" />
|
76 |
| -<uses-permission android:name="android.permission.VIBRATE" /> |
77 |
| -``` |
78 | 63 |
|
79 |
| -### Add API keys |
| 64 | +<!-- Declare permissions --> |
| 65 | +<uses-permission android:name="android.permission.CAMERA" /> |
| 66 | +<uses-permission android:name="android.permission.INTERNET" /> |
| 67 | +<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> |
| 68 | +
|
| 69 | +``` |
80 | 70 |
|
81 |
| -Use the Admin Dashboard to find the Socure public key. |
| 71 | +### Launch Socure DocV SDK |
82 | 72 |
|
83 |
| -- Add the key to your application: |
| 73 | +To launch the Socure DocV SDK, call the launch function using `ActivityResultLauncher`. |
84 | 74 |
|
85 | 75 | ```
|
86 |
| -<string name="socurePublicKey" translatable="false">YOUR_KEY_HERE</string> |
87 |
| -``` |
88 |
| -- Add the API key to `string.xml` as a resource. |
| 76 | +val startForResult: ActivityResultLauncher<Intent> = registerForActivityResult(...) |
| 77 | +... |
| 78 | +startForResult.launch(SocureDocVHelper.getIntent(context, socure-api-key, config)) |
89 | 79 |
|
90 |
| -### Configuration and usage |
| 80 | +``` |
91 | 81 |
|
92 |
| -For instructions on how to configure the SDK, see the [Android SDK documentation](https://developer.socure.com/docs/sdks/docv/android-sdk). |
| 82 | +Once the Socure DocV SDK is successfully launched, you will be able to set up a listener for Callback Events and customize the most aspect of the interface. For more information, see the [Android SDK documentation](https://developer.socure.com/docs/sdks/docv/android-sdk/android-sdk-v3/) on DevHub. |
0 commit comments