Skip to content

Commit

Permalink
v14.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
RN SDK Release User committed Nov 21, 2024
1 parent 6646661 commit 468c1d7
Show file tree
Hide file tree
Showing 39 changed files with 3,074 additions and 3,338 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [14.0.0] - 2024-11-04

### Changed:

- Updated underlying Onfido native SDK version:
- iOS 32.1.x (up from 30.6.x)
- Android 22.0.x (up from 21.2.x)

- Upgraded to RN 0.73.8
- Updated Kotlin version to 1.9.22
- Updated Java version to 11

## [13.2.0] - 2024-09-10

### Changed:
Expand Down
2 changes: 1 addition & 1 deletion ONFIDO_STUDIO.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ npm --prefix node_modules/@onfido/react-native-sdk/ run updateBuildGradle
Change ios/Podfile to use version 13:

```ruby
platform :ios, '13.0'
platform :ios, '13.4'
```

Add descriptions for camera and microphone permissions to `ios/YourProjectName/Info.plist`:
Expand Down
198 changes: 119 additions & 79 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- [4. Completing a session](#completing-a-session)
- [Advanced flow customization](#advanced-flow-customization)
- [Advanced callbacks](#advanced-callbacks)
- [Custom media callbacks](#custom-media-callbacks)
- [More information](#more-information)
- [Raising support issues](#support)

Expand Down Expand Up @@ -142,9 +143,9 @@ class YourCustomApplication : MultiDexApplication() {

#### Update your iOS configuration files

Change `ios/Podfile` to use version 12:
Change `ios/Podfile` to use version 13:
```
platform :ios, '12.0'
platform :ios, '13.4'
```

Add descriptions for camera and microphone permissions to `ios/YourProjectName/Info.plist`:
Expand Down Expand Up @@ -478,84 +479,15 @@ localisation: {

## Completing a session

### Media Callbacks

#### Introduction

Onfido provides the possibility to integrate with our Smart Capture SDK, without the requirement of using this data only through the Onfido API. Media callbacks enable you to control the end user data collected by the SDK after the end user has submitted their captured media. As a result, you can leverage Onfido’s advanced on-device technology, including image quality validations, while still being able to handle end users’ data directly. This unlocks additional use cases, including compliance requirements and multi-vendor configurations, that require this additional flexibility.

**This feature must be enabled for your account.** Please contact your Onfido Solution Engineer or Customer Success Manager.

#### Implementation
To use this feature, use `Onfido.addCustomMediaCallback` and provide the callback.

```javascript
Onfido.addCustomMediaCallback(
mediaResult => {
if (mediaResult.captureType === 'DOCUMENT') {
// Callback code here
} else if (mediaResult.captureType === 'FACE') {
// Callback code here
} else if (mediaResult.captureType === 'VIDEO') {
// Callback code here
}
}
);
```

#### User data
The callbacks return an object including the information that the SDK normally sends directly to Onfido. The callbacks are invoked when the end user confirms submission of their image through the SDK’s user interface.

**Note:** Currently, end user data will still automatically be sent to the Onfido backend, but you are not required to use Onfido to process this data.

The callback returns 3 possible objects. Please note that `captureType` refers to the type of the media capture in each case.
These can be `DOCUMENT`, `FACE` or `VIDEO`.

1. For documents (`captureType` is `DOCUMENT`), the callback returns:
```json5
{
captureType: String
side: String
type: String
issuingCountry: String?
fileData: String
fileName: String
fileType: String
}
```
### Handling callbacks

**Notes:**
- `issuingCountry` is optional based on end-user selection, and can be `null`.
- `fileData` is a String representation of the byte array data corresponding to the captured photo of the document.
- If a document was scanned using NFC, the callback will return the passport photo in `fileData` but no additional data.
When the Onfido SDK session concludes, a range of completion callback functions may be triggered.

2. For live photos (`captureType` is `FACE`), the callback returns:
```json5
{
captureType: String
fileData: String
fileName: String
fileType: String
}
```
**Note:** `fileData` is a String representation of the byte array data corresponding to the captured live photo.
For detailed information regarding handling callbacks for identity verification workflows orchestrated using Onfido Studio, please refer to our native [iOS](https://documentation.onfido.com/sdk/ios/#handling-callbacks) and [Android](https://documentation.onfido.com/sdk/android/#handling-callbacks) documentation.

3. For live videos (`captureType` is `VIDEO`), the callback returns:
```json5
{
captureType: String
fileData: String
fileName: String
fileType: String
}
```
**Note:** `fileData` is a String representation of the byte array data corresponding to the captured video.
For callbacks for manually-defined verification flows implemented without Onfido Studio, please refer to the [section below](#advanced-callbacks).

Please note that, for your convenience, Onfido provides the `byteArrayStringToBase64` helper function to convert the `fileData` from String to a Base64 format. Here is an example of how to use it:
```javascript
let byteArrayString = mediaResult.fileData;
let base64FileData = Onfido.byteArrayStringToBase64(byteArrayString);
```
For documentation regarding advanced callbacks used for returning media uploaded by the end user (such as identity documents or face captures), please refer to the [Custom Media Callbacks](#custom-media-callbacks) section of this document.

### Generating verification reports

Expand Down Expand Up @@ -683,6 +615,10 @@ export default class App extends Component {

## Advanced callbacks

### Handling callbacks

When the Onfido SDK session concludes, a range of completion callback functions may be triggered. The callbacks detailed in this section apply to manually-defined identity verification flows implemented without Onfido Studio. For callbacks for verification workflows orchestrated using Onfido Studio, please refer to the [section above](#completing-a-session).

### Success Response

If the start function is successful, a json file response will include a `face` section if `captureFace` was specified, a `document` section if `captureDocument` was specified, or both sections if they were both requested in the config.
Expand All @@ -700,6 +636,16 @@ For example:
id: "456-567",
variant: "VIDEO" // PHOTO or VIDEO
},
proofOfAddress:{
front: {
id: "9763"
},
back: {
id: "8263"
},
type: {
id: "6329"
}
}
```
Expand All @@ -721,11 +667,105 @@ For example:
}
```
### Handling callbacks
### Custom biometric token storage
When using the authentication with local storage solution, by default the SDK manages biometric token storage. The SDK also allows the clients to take control of the token lifecycle and exposes an API to override the default implementation to read and write the token, so it can be stored on device, in cloud, in a keystore or on your premises.
When the Onfido SDK session concludes, a range of callback functions may be triggered.
#### Implementation
1. Provide a custom callback using `Onfido.addBiometricTokenCallback`
Please note that biometric token callback uses `customerUserHash` parameter. This is a unique identifier for the user that can be used as a key for token storage. Feel free to ignore it if you have your own identifier.
```javascript
Onfido.addBiometricTokenCallback({
onTokenGenerated: (customerUserHash, biometricToken) => {
// Called when new biometric token is generated during onboarding
// Use this callback to securely store the biometric token
},
onTokenRequested: (customerUserHash, provideToken) => {
// Called when biometric token is requested during re-authentication
// Provide the token to the SDK via provideToken("your-biometric-token");
provideToken(<biometricToken>);
}
});
```
## Custom Media Callbacks
### Introduction
Onfido provides the possibility to integrate with our Smart Capture SDK, without the requirement of using this data only through the Onfido API. Media callbacks enable you to control the end user data collected by the SDK after the end user has submitted their captured media. As a result, you can leverage Onfido’s advanced on-device technology, including image quality validations, while still being able to handle end users’ data directly. This unlocks additional use cases, including compliance requirements and multi-vendor configurations, that require this additional flexibility.
**This feature must be enabled for your account.** Please contact your Onfido Solution Engineer or Customer Success Manager.
### Implementation
To use this feature, use `Onfido.addCustomMediaCallback` and provide the callback.
```javascript
Onfido.addCustomMediaCallback(
mediaResult => {
if (mediaResult.captureType === 'DOCUMENT') {
// Callback code here
} else if (mediaResult.captureType === 'FACE') {
// Callback code here
} else if (mediaResult.captureType === 'VIDEO') {
// Callback code here
}
}
);
```
The callbacks return an object including the information that the SDK normally sends directly to Onfido. The callbacks are invoked when the end user confirms submission of their image through the SDK’s user interface.
**Note:** Currently, end user data will still automatically be sent to the Onfido backend, but you are not required to use Onfido to process this data.
The callback returns 3 possible objects. Please note that `captureType` refers to the type of the media capture in each case.
These can be `DOCUMENT`, `FACE` or `VIDEO`.
1. For documents (`captureType` is `DOCUMENT`), the callback returns:
```json5
{
captureType: String
side: String
type: String
issuingCountry: String?
fileData: String
fileName: String
fileType: String
}
```
**Notes:**
- `issuingCountry` is optional based on end-user selection, and can be `null`.
- `fileData` is a String representation of the byte array data corresponding to the captured photo of the document.
- If a document was scanned using NFC, the callback will return the passport photo in `fileData` but no additional data.
2. For live photos (`captureType` is `FACE`), the callback returns:
```json5
{
captureType: String
fileData: String
fileName: String
fileType: String
}
```
**Note:** `fileData` is a String representation of the byte array data corresponding to the captured live photo.
3. For live videos (`captureType` is `VIDEO`), the callback returns:
```json5
{
captureType: String
fileData: String
fileName: String
fileType: String
}
```
**Note:** `fileData` is a String representation of the byte array data corresponding to the captured video.
For documentation regarding handling callbacks, please refer to our native [iOS](https://documentation.onfido.com/sdk/ios/#handling-callbacks-1) and [Android](https://documentation.onfido.com/sdk/android/#handling-callbacks-1) documentation.
Please note that, for your convenience, Onfido provides the `byteArrayStringToBase64` helper function to convert the `fileData` from String to a Base64 format. Here is an example of how to use it:
```javascript
let byteArrayString = mediaResult.fileData;
let base64FileData = Onfido.byteArrayStringToBase64(byteArrayString);
```
## More Information
Expand Down
5 changes: 2 additions & 3 deletions SampleApp/Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"
ruby '>= 3.2.4'

# See https://github.com/facebook/react-native/issues/42697
gem 'cocoapods', '1.14.3'
gem 'cocoapods', '1.16.1'
Loading

0 comments on commit 468c1d7

Please sign in to comment.