Skip to content

Commit

Permalink
v13.1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
RN SDK Release User committed Sep 2, 2024
1 parent 39b92de commit 7ca57d6
Show file tree
Hide file tree
Showing 13 changed files with 93 additions and 18 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ 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).

## [13.1.0] - 2024-08-21

### Changed:

- Updated underlying Onfido native SDK version:
- iOS 30.5.x (up from 30.4.x)
- Android 21.1.x (up from 21.0.x)

## [13.0.0] - 2024-07-30

### Added:
Expand Down
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,48 @@ Dark theme customization for Android is implemented according to the same method

Dark theme customization for iOS is implemented according to the same methodology as the native Android SDK. You can find detailed documentation [here](https://documentation.onfido.com/sdk/ios/#dark-theme).

### Co-branding

The Onfido React Native SDK allows for a number of co-branding options that affect the display of the Onfido logo at the bottom of the Onfido screens.

#### Logo co-branding

- **`logoCobrand {Boolean}` - optional**

You may specify a set of images to be defined in the `logoCobrand` property. You must provide the path to an image for use in 'dark' mode and a separate image for 'light' mode.

##### Android

The two logo images must be placed in the `drawables` resource folder of your application (`/res/drawables`), named as follows:

- `cobrand_logo_light.xml` (accessible in code by `R.drawable.cobrand_logo_light`)
- `cobrand_logo_dark.xml` (accessible in code by `R.drawable.cobrand_logo_dark`)

##### iOS

The two logo images must be placed in the `assets` folder of your application.

The `logoCobrand` property itself takes a boolean as a value, which by default is set to `false`.

#### Hide Onfido logo

- **`hideLogo {Boolean}` - optional**

In addition to `logoCobrand`, you can also choose to hide the Onfido logo from the footer watermark. The `hideLogo` property takes a boolean as a value, which by default is set to `false`.

To apply the `logoCobrand` and `hideLogo` options for both Android and iOS, define their values in the `Onfido.start` function:

```javascript
Onfido.start({
sdkToken: "<TOKEN_HERE>",
workflowRunId: "<YOUR_WORKFLOW_RUN_ID>",
hideLogo: "<TRUE/FALSE>",
logoCobrand: "<TRUE/FALSE>"
})
```

**Please note**: Logo co-branding options must be enabled by Onfido. Please [contact](mailto:[email protected]) your Solutions Engineer or Customer Success Manager to activate the feature.

### Language localization

The React Native SDK supports and maintains translations for over 40 languages, available for use with both Android and iOS.
Expand Down
10 changes: 5 additions & 5 deletions SampleApp/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ PODS:
- ReactCommon/turbomodule/core (= 0.72.6)
- fmt (6.2.1)
- glog (0.3.5)
- Onfido (30.4.0)
- onfido-react-native-sdk (12.3.0):
- Onfido (~> 30.4.0)
- Onfido (30.5.0)
- onfido-react-native-sdk (13.0.0):
- Onfido (~> 30.5.0)
- React
- RCT-Folly (2021.07.22.00):
- boost
Expand Down Expand Up @@ -529,8 +529,8 @@ SPEC CHECKSUMS:
FBReactNativeSpec: 966f29e4e697de53a3b366355e8f57375c856ad9
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
Onfido: 5715e65965133acfd12676e8a69b1389fac43ca5
onfido-react-native-sdk: bf0ccd95e0ef2faf032f889869eb235eb4f193e7
Onfido: 7349ac22e556eda20b7b360c06bdd29204580861
onfido-react-native-sdk: 1f46e061e3b249d3231f1e369e9ea2540901c958
RCT-Folly: 424b8c9a7a0b9ab2886ffe9c3b041ef628fd4fb1
RCTRequired: 28469809442eb4eb5528462705f7d852948c8a74
RCTTypeSafety: e9c6c409fca2cc584e5b086862d562540cb38d29
Expand Down
2 changes: 1 addition & 1 deletion SampleApp/yalc.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "v1",
"packages": {
"@onfido/react-native-sdk": {
"signature": "31603b6db695bea0356ea3de1d7c5922",
"signature": "53cc50894149d595a27b514f8f65db92",
"file": true
}
}
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
def DEFAULT_COMPILE_SDK_VERSION = 34
def DEFAULT_MIN_SDK_VERSION = 21
def DEFAULT_TARGET_SDK_VERSION = 34
def NATIVE_ANDROID_SDK_VERSION = "21.0.+"
def NATIVE_ANDROID_SDK_VERSION = "21.1.+"

def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
Expand Down
2 changes: 1 addition & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

<meta-data
android:name="onfido_integration_version"
android:value="13.0.0" />
android:value="13.1.0" />
</application>
</manifest>
8 changes: 7 additions & 1 deletion ios/OnfidoPluginConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ struct OnfidoPluginConfig: Codable {
let workflowRunId: String?
let flowSteps: OnfidoFlowSteps?
let localisation: OnfidoLocalisation?
let theme: Theme?
let hideLogo: Bool?
let logoCoBrand: Bool?
let disableNFC: Bool?
Expand Down Expand Up @@ -41,12 +42,17 @@ struct OnfidoCaptureFace: Codable {

struct OnfidoLocalisation: Codable {
let stringsFileName: String?

enum CodingKeys: String, CodingKey {
case stringsFileName = "ios_strings_file_name"
}
}

enum Theme: String, Codable {
case dark = "DARK"
case light = "LIGHT"
}

enum OnfidoDocumentType: String, Codable {
case passport = "PASSPORT"
case drivingLicence = "DRIVING_LICENCE"
Expand Down
21 changes: 17 additions & 4 deletions ios/OnfidoSdk.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class OnfidoSdk: RCTEventEmitter {
private let onfidoFlowBuilder = OnfidoFlowBuilder()
private let configParser = OnfidoConfigParser()
private var callbackTypes: [CallbackType] = []

@objc
func start(_ config: NSDictionary,
resolver resolve: @escaping RCTPromiseResolveBlock,
Expand All @@ -38,13 +38,26 @@ final class OnfidoSdk: RCTEventEmitter {
let appearanceFilePath = Bundle.main.path(forResource: "colors", ofType: "json")
let appearance = try loadAppearanceFromFile(filePath: appearanceFilePath)

if
#available(iOS 12.0, *),
let theme = onfidoConfig.theme
{
switch theme {
case .dark:
appearance.setUserInterfaceStyle(.dark)
case .light:
appearance.setUserInterfaceStyle(.light)
default:
appearance.setUserInterfaceStyle(.unspecified)
}
}
let mediaCallback: CallbackReceiver?
if callbackTypes.contains(.media) {
mediaCallback = CallbackReceiver(withCallback: processMediaResult(_:))
} else {
mediaCallback = nil
}

let onfidoFlow: OnfidoFlow = try onfidoFlowBuilder.build(
with: onfidoConfig,
appearance: appearance,
Expand Down Expand Up @@ -75,9 +88,9 @@ final class OnfidoSdk: RCTEventEmitter {
return
}
})
guard
guard
let window = UIApplication.shared.windows.first,
let topMostViewController = window.rootViewController?.findTopMostController()
let topMostViewController = window.rootViewController?.findTopMostController()
else {
reject("error", "Unable to locate presenting view controller", nil)
return
Expand Down
8 changes: 7 additions & 1 deletion ios/OnfidoSdkTests/OnfidoSdkTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class OnfidoSdkTests : XCTestCase {

XCTAssertEqual( appearancePublic.primaryColor, expectedPrimaryColor )
}

func testLoadColorFile() throws {
let appearanceFilePath = String(#file[...#file.lastIndex(of: "/")!] + "colors.json")
let appearance = try loadAppearancePublicFromFile(filePath: appearanceFilePath)!
Expand All @@ -44,6 +44,7 @@ class OnfidoSdkTests : XCTestCase {
.init(countryCode: nil, alpha2CountryCode: nil, docType: nil, allowedDocumentTypes: nil))
),
localisation: nil,
theme: nil,
hideLogo: nil,
logoCoBrand: nil,
disableNFC: nil,
Expand Down Expand Up @@ -90,6 +91,7 @@ class OnfidoSdkTests : XCTestCase {
)
),
localisation: nil,
theme: nil,
hideLogo: nil,
logoCoBrand: nil,
disableNFC: nil,
Expand Down Expand Up @@ -141,6 +143,7 @@ class OnfidoSdkTests : XCTestCase {
)
),
localisation: nil,
theme: nil,
hideLogo: nil,
logoCoBrand: nil,
disableNFC: nil,
Expand Down Expand Up @@ -188,6 +191,7 @@ class OnfidoSdkTests : XCTestCase {
)
)),
localisation: nil,
theme: nil,
hideLogo: nil,
logoCoBrand: nil,
disableNFC: nil,
Expand Down Expand Up @@ -231,6 +235,7 @@ class OnfidoSdkTests : XCTestCase {
)
)),
localisation: nil,
theme: nil,
hideLogo: nil,
logoCoBrand: nil,
disableNFC: nil,
Expand Down Expand Up @@ -264,6 +269,7 @@ class OnfidoSdkTests : XCTestCase {
workflowRunId: nil,
flowSteps: .init(proofOfAddress: true),
localisation: nil,
theme: nil,
hideLogo: nil,
logoCoBrand: nil,
disableNFC: nil,
Expand Down
2 changes: 1 addition & 1 deletion ios/PluginMetadata.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ - (instancetype)init
self = [super init];
if (self) {
_pluginPlatform = @"react-native";
_pluginVersion = @"13.0.0";
_pluginVersion = @"13.1.0";
}
return self;
}
Expand Down
2 changes: 1 addition & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : Flip
# end

target 'OnfidoSdk' do
pod 'Onfido', '~> 30.4.0'
pod 'Onfido', '~> 30.5.0'

config = use_native_modules!
use_react_native!(
Expand Down
2 changes: 1 addition & 1 deletion onfido-react-native-sdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ Pod::Spec.new do |s|
s.requires_arc = true

s.dependency "React"
s.dependency "Onfido", "~> 30.4.0"
s.dependency "Onfido", "~> 30.5.0"
end
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@onfido/react-native-sdk",
"title": "React Native Onfido Sdk",
"version": "13.0.0",
"version": "13.1.0",
"description": "Onfido React Native SDK",
"main": "index.ts",
"scripts": {
Expand Down

0 comments on commit 7ca57d6

Please sign in to comment.