Skip to content

Commit

Permalink
changes for 30.5.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
J. Doe (https://devcenter.bitrise.io/builds/setting-your-git-credentials-on-build-machines/) committed Aug 20, 2024
1 parent 16fc2f8 commit 287b8ae
Show file tree
Hide file tree
Showing 50 changed files with 403 additions and 1,462 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

**Note**: If the strings translations change it will result in a MINOR version change, therefore you are responsible for testing your translated layout in case you are using custom translations. [More on language localisation](README.md#language-customisation)

## [30.5.0] - 2024-08-08

### Changed

- Studio: Added support to exit the flow in WebViews

### Fixed

- Fixed a bug that could cause the step after Motion to be skipped, instead repeating the Motion step
- Fixed regression introduced in 30.3.0 where Motion would always request microphone permission even if not configured to record audio

## [30.4.0] - 2024-07-18

### Added
Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ let package = Package(

.binaryTarget(
name: "Onfido",
url: "https://s3-eu-west-1.amazonaws.com/onfido-sdks/ios/Onfido-v30.4.0.zip",
checksum: "06a1b4dce217d05f7abb9f1294275fba63dbeb86f81a16f4011e71a25a010536"
url: "https://s3-eu-west-1.amazonaws.com/onfido-sdks/ios/Onfido-v30.5.0.zip",
checksum: "0f3daadd08a5f93ea0db59bfdd953b4a3419e7fd32c0109ef0b38da107fa3e8b"
),


Expand Down
173 changes: 115 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,29 +116,15 @@ The SDK is available in the [GitHub Releases tab](https://github.com/onfido/onfi
download the compressed framework. You can find the latest
release [here](https://github.com/onfido/onfido-ios-sdk/releases/latest).

1. [Download](https://github.com/onfido/onfido-ios-sdk/releases/latest) the compressed debug zip file containing
the `Onfido.framework`
2. Uncompress the zip file and then move the `Onfido.framework` artefact into your project
3. Add `Onfido.framework` located within your project to the `Embedded binaries` section in the `General` tab of your
1. [Download](https://github.com/onfido/onfido-ios-sdk/releases/latest) the compressed zip file containing
the `Onfido.xcframework`
2. Uncompress the zip file and then move the `Onfido.xcframework` artefact into your project folder
3. Open your app's project file in Xcode. Then select your app's target under target list
4. Add `Onfido.xcframework` located within your project to the `Embedded binaries` section in the `General` tab of your
iOS app target
4. Open your app's project file in Xcode. Then select your app's target under target list
5. Next select the `Build Phases` tab and under the `Embed Frameworks` step add a new `Run Script Phase`. Name
it `Onfido Framework Archive`
6. In the text area, add the following code:

```bash
if [[ "$ACTION" != "install" ]]; then
exit 0;
fi

FRAMEWORK_DIR="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
ONFIDO_FRAMEWORK="${FRAMEWORK_DIR}/Onfido.framework"

cd "${ONFIDO_FRAMEWORK}"

lipo -remove i386 Onfido -o Onfido
lipo -remove x86_64 Onfido -o Onfido
```
⚠️ Do not add the xcframework as _resources_ to your app target, as only few files are required that xcode will
automatically take during build.

#### Non-Swift apps

Expand All @@ -164,6 +150,9 @@ force Xcode to package Swift runtime libraries required for the Onfido iOS SDK t

## Initializing the SDK

> ⚠️ The following SDK initialization documentation applies to identity verification workflows orchestrated using Onfido Studio.
> For integrations where the verification steps are manually defined and configured, please refer to the [Advanced flow customization](#advanced-flow-customization) section below.
The iOS SDK has multiple initialization and customization options that provide flexibility to your integration, while remaining easy to integrate.

### Defining a workflow
Expand All @@ -188,6 +177,8 @@ When defining workflows and creating identity verifications, we highly recommend

The SDK is authenticated using SDK tokens. Onfido Studio generates and exposes SDK tokens in the workflow run payload returned by the API when a workflow run is [created](https://documentation.onfido.com/#create-workflow-run).

SDK tokens for Studio can only be used together with the specific workflow run they are generated for, and remain valid for a period of five weeks.

**Note**: You must never use API tokens in the frontend of your application as malicious users could discover them in your source code. You should only use them on your server.

### Build a configuration object
Expand Down Expand Up @@ -297,19 +288,6 @@ appearance.primaryColor = <DESIRED_UI_COLOR_HERE>;
appearance.primaryTitleColor = <DESIRED_UI_COLOR_HERE>;
```

To apply the appearance, you can use the method below:

##### Objective-C

```Objective-C
@objc
@discardableResult
public func withAppearance(_ appearance: Appearance) -> WorkflowConfiguration {
self.appearance = appearance
return self
}
```
Please refer to the [SDK customization documentation](https://documentation.onfido.com/sdk/sdk-customization#ui-customization) for details of the supported UI options that can be set in this property.

#### Dark theme
Expand All @@ -332,7 +310,7 @@ appearance.setUserInterfaceStyle(.dark)

##### Objective-C

```Objective-C
```objc
ONAppearance *appearance = [ONAppearance new];
[appearance setUserInterfaceStyle:UIUserInterfaceStyleDark];
```
Expand All @@ -350,24 +328,103 @@ configBuilder.withAppearance(appearance)

##### Objective-C

```Objective-C
```objc
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder];
[configBuilder withAppearance:appearance];
```
### Co-branding
The Onfido SDK allows for two co-branding options that affect the display of the Onfido logo at the bottom of the Onfido screens.
#### Text co-branding
- **`cobrand {Object}` - optional**
The most effective way to add your brand to the footer watermark is by use of the `cobrand` property under `enterpriseFeatures`. This property takes a `text` parameter.
![Example of text cobranding](assets/text_co_brand.png)
##### Swift
```swift
let companyName = "MyCompany"
let enterpriseFeatures = EnterpriseFeatures.builder()
.withCobrandingText(companyName)
.build()
```

##### Objective-C

```objc
NSString *companyName = @"MyCompany";
ONEnterpriseFeaturesBuilder *enterpriseFeatures = [ONEnterpriseFeatures builder];
[enterpriseFeatures withCobrandingText: companyName];
[enterpriseFeatures build];
```
**Please note**: Text co-branding must be enabled by Onfido. Please [contact](mailto:[email protected]) your Solutions Engineer or Customer Success Manager to activate the feature.
#### Logo co-branding
- **`logoCobrand {Object}` - optional**
As an alternative to `cobrand`, you may specify a set of images to be defined in the `logoCobrand` property under `enterpriseFeatures`. You must provide the path to an image for use in 'dark' mode and a separate image for 'light' mode. Both images must have a resolution of 144x32.
##### Swift
```swift
let onfidoEnterpriseFeatures = EnterpriseFeatures.builder()
.withCobrandingLogo(
UIImage(named: "imageName_for_lightmode")!,
cobrandingLogoDarkMode: UIImage(named: "imageName_for_darkmode")!
)
.build()
```

##### Objective-C

```objc
ONEnterpriseFeaturesBuilder *enterpriseFeatures = [ONEnterpriseFeatures builder];
[enterpriseFeatures withCobrandingLogo:
[UIImage imageNamed:@"onfido-logo-white"] cobrandingLogoDarkMode:[UIImage imageNamed:@"onfido-logo-grey"]
];
[enterpriseFeatures build];
```

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


#### Add co-branding to OnfidoConfig

To apply co-branding, add the enterprise features object to `OnfidoConfig`:

##### Swift

```swift
let configBuilder = OnfidoConfig.builder()
configBuilder.withEnterpriseFeatures(enterpriseFeatures)
```

##### Objective-C

```objc
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder];
[configBuilder withEnterpriseFeatures: enterpriseFeatures];
```
### Language localization
The Onfido SDK supports and maintains translations for over 40 languages.
The strings used within the SDK can be customized by having a `Localizable.strings` in your app for the desired language
and by configuring the flow using the `withCustomLocalization()` method on the configuration builder.
##### Objective-C
##### Swift
```Objective-C
@objc
public func withCustomLocalization() {
configBuilder.withCustomLocalization() // will look for localizable strings in your Localizable.strings file
```swift
- (void)withCustomLocalization {
[self.configBuilder withCustomLocalization]; // will look for localizable strings in your Localizable.strings file
}
```

Expand Down Expand Up @@ -521,7 +578,7 @@ let config = try OnfidoConfig.builder()

##### Objective-C

```Objective-C
```objc
-(void) getSDKToken: (void(^)(NSString *)) handler {
// <Your network request logic to retrieve SDK token goes here>
handler(sdkToken);
Expand Down Expand Up @@ -556,7 +613,7 @@ let onfidoFlow = OnfidoFlow(withConfiguration: config)

##### Objective-C

```Objective-C
```objc
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder];

[configBuilder withSdkToken:@"YOUR_SDK_TOKEN"];
Expand Down Expand Up @@ -592,7 +649,7 @@ try onfidoRun.run(from: yourViewController, animated: true)

##### Objective-C

```Objective-C
```objc
NSError *runError = NULL;
[onFlow runFrom:yourViewController animated:YES error:&runError completion:nil];

Expand Down Expand Up @@ -634,7 +691,7 @@ configBuilder.withAppearance(appearance)

##### Objective-C

```Objective-C
```objc
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder];
[configBuilder withAppearance:appearance];
```
Expand Down Expand Up @@ -674,7 +731,7 @@ let config = try OnfidoConfig.builder()

##### Objective-C

```Objective-C
```objc
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder];
[configBuilder withSdkToken:@"YOUR_SDK_TOKEN_HERE"];
...
Expand Down Expand Up @@ -824,7 +881,7 @@ let config = try OnfidoConfig.builder()

##### Objective-C

```Objective-C
```objc
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder];
[configBuilder withSdkToken:@"YOUR_SDK_TOKEN_HERE"];

Expand Down Expand Up @@ -881,7 +938,7 @@ let config = try OnfidoConfig.builder()

##### Objective-C

```Objective-C
```objc
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder];
[configBuilder withSdkToken:@"YOUR_SDK_TOKEN_HERE"];

Expand Down Expand Up @@ -917,7 +974,7 @@ let config = try OnfidoConfig.builder()

##### Objective-C

```Objective-C
```objc
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder];
[configBuilder withDocumentStepWithSelectableDocumentTypes: @[@(SelectableDocumentTypePassport), @(SelectableDocumentTypeDrivingLicence)]];
```
Expand Down Expand Up @@ -958,7 +1015,7 @@ let config = try! OnfidoConfig.builder()

#### Objective-C

```Objective-C
```objc
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder];
[configBuilder withSdkToken:@"YOUR_SDK_TOKEN_HERE"];

Expand Down Expand Up @@ -994,7 +1051,7 @@ let config = try! OnfidoConfig.builder()

#### Objective-C

```Objective-C
```objc
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder];
[configBuilder withSdkToken:@"YOUR_SDK_TOKEN_HERE"];

Expand Down Expand Up @@ -1029,7 +1086,7 @@ let config = try! OnfidoConfig.builder()

#### Objective-C

```Objective-C
```objc
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder];
[configBuilder withSdkToken:@"YOUR_SDK_TOKEN_HERE"];

Expand Down Expand Up @@ -1167,7 +1224,7 @@ let config = try OnfidoConfig.builder()

##### Objective-C

```Objective-C
```objc
ONFlowConfigBuilder *configBuilder = [ONFlowConfig builder];
[configBuilder withSdkToken:@"YOUR_SDK_TOKEN_HERE"];
[configBuilder withProofOfAddressStep];
Expand Down Expand Up @@ -1214,7 +1271,7 @@ To receive the result from the flow, you should pass a callback to the instance

An instance of `ONFlowResponse` is passed back to the callback with 3 properties:

```Objective-C
```objc
(^responseHandlerBlock)(ONFlowResponse *response) {
if (response.userCanceled) {
} else if (response.results) {
Expand Down Expand Up @@ -1277,7 +1334,7 @@ you want to see further information, you can access the result object.

Example for a document capture:

```Objective-C
```objc
NSPredicate *documentResultPredicate = [NSPredicate predicateWithBlock:^BOOL(id flowResult, NSDictionary *bindings) {
if (((ONFlowResult *)flowResult).type == ONFlowResultTypeDocument) {
return YES;
Expand Down Expand Up @@ -1382,7 +1439,7 @@ instance.

The `NSError` contained within the `ONFlowResponse`'s `error` property can be handled as follows:

```Objective-C
```objc
switch (error.code) {
case ONFlowErrorCameraPermission:
// Occurs if the user denies permission to the SDK during the flow
Expand Down Expand Up @@ -1417,7 +1474,7 @@ exception.

You can handle run exceptions as shown below:

```Objective-C
```objc
NSError *runError = NULL;
[onFlow runFrom:yourViewController animated:YES error:&runError completion:nil]; //`yourViewController` should be your view controller

Expand Down Expand Up @@ -1663,7 +1720,7 @@ configBuilder.build()

##### Objective-C

```Objective-C
```objc
ONFlowConfigBuilder * builder =[ONFlowConfig builder];
...
NSError * error = NULL;
Expand Down
2 changes: 1 addition & 1 deletion SampleApp/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def setup_shared_pods
use_frameworks!
inhibit_all_warnings!

pod 'Onfido', '30.4.0'
pod 'Onfido', '30.5.0'
end

target 'SampleApp' do
Expand Down
2 changes: 1 addition & 1 deletion SampleAppObjC/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def setup_shared_pods
use_frameworks!
inhibit_all_warnings!

pod 'Onfido', '30.4.0'
pod 'Onfido', '30.5.0'
end

target 'SampleAppObjC' do
Expand Down
Binary file added assets/text_co_brand.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 287b8ae

Please sign in to comment.