@getyoti/react-native-yoti-doc-scan
Advanced tools
Comparing version 1.12.1 to 1.13.0
{ | ||
"name": "@getyoti/react-native-yoti-doc-scan", | ||
"version": "1.12.1", | ||
"version": "1.13.0", | ||
"description": "Yoti Doc Scan for React Native", | ||
@@ -5,0 +5,0 @@ "main": "YotiDocScan.js", |
@@ -131,3 +131,2 @@ ![YotiBanner](./yoti_banner.png) | ||
Import the SDK with: | ||
```javascript | ||
@@ -137,25 +136,27 @@ import YotiDocScan from '@getyoti/react-native-yoti-doc-scan; | ||
Call the `startSession` method with your session Id and client session token. | ||
The method accepts two callbacks: one invoked on success and the other when the result is a failure. | ||
Call the `startSession` method with your session ID and client session token. | ||
The method accepts two callbacks: one invoked on success, and the other when the result is a failure. | ||
```javascript | ||
function onSuccess (code, description) { | ||
// handle success scenario | ||
} | ||
function onError (code, description) { | ||
// handle error scenario | ||
} | ||
YotiDocScan.startSession( | ||
sessionId, | ||
clientSessionToken, | ||
onSuccess, | ||
onError | ||
); | ||
}} | ||
function onSuccess (code, description) { | ||
// handle success scenario | ||
} | ||
function onError (code, description) { | ||
// handle error scenario | ||
} | ||
YotiDocScan.startSession( | ||
sessionId, | ||
clientSessionToken, | ||
onSuccess, | ||
onError | ||
); | ||
``` | ||
Optionally, you can specify Android request code. If not, by default it is set to 9001: | ||
In addition, you can choose to also specify an Android request code, or set the primary color of the iOS SDK using an RGB value. E.g.: | ||
```javascript | ||
YotiDocScan.setRequestCode(8888); | ||
YotiDocScan.setRequestCode(8888); // default: 9001 | ||
YotiDocScan.setPrimaryColorRGB(0, 0, 0); // default: (34, 157, 255) | ||
``` | ||
To customize the colors of the Android SDK, please refer to its documentation [here](https://github.com/getyoti/yoti-doc-scan-android#colours). | ||
Your callbacks will receive a consistent response with two parameters: `code` (number) and `description` (string). | ||
@@ -162,0 +163,0 @@ The `code` is always populated with one of the values in the results table below. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
139379
254