Skip to content

Commit

Permalink
Updated version
Browse files Browse the repository at this point in the history
  • Loading branch information
keremgunduz86 committed Jul 2, 2019
1 parent 61e96a5 commit b16b915
Show file tree
Hide file tree
Showing 11 changed files with 120 additions and 231 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@ 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)

## [12.2.0] - 2019-07-02

### Added
- Public: Added United States' driver's license autocapture as an experimental feature. Can be enabled by calling withUSDLAutocapture() in the OnfidoConfig.builder()

### Fixed
- UI: Unsupported screen appears and gets stuck in app only supporting portrait mode
- UI: Fixed the UI issue about showing unnecessary oval shape in upload progress bar view
- UI: Poland's endonym on country selection screen
- UI: Fixed the crash on iPad for the apps that support only landscape orientation

### Added
- UI: Added dynamic font size support for video capture confirmation screen
- UI: Added support for the new token format
- Public: Updated README with adding SDK size impact information

## [12.1.0] - 2019-06-18

### Changed
Expand Down
6 changes: 5 additions & 1 deletion Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@
"onfido_glare_detected_title" = "Glare detected";
"onfido_glare_detected_subtitle" = "Try moving away from direct light";

/* Document autocapture */

"onfido_autocapture_info" = "Your picture will be taken automatically";
"onfido_press_button_capture" = "Press the button to take a picture";

/* Document capture confirmation */

"onfido_message_check_readability_subtitle_passport" = "Make sure your passport details are clear to read, with no blur or glare";
Expand Down Expand Up @@ -138,7 +143,6 @@
"onfido_liveness_challenge_digits_title" = "Say each digit out loud";
"onfido_liveness_challenge_turn_left_title" = "Look to the left and back";
"onfido_liveness_challenge_turn_right_title" = "Look to the right and back";
"onfido_liveness_challenge_open_mouth_title" = "Open and close your\n mouth";
"onfido_wrong_side" = "Wrong side";
"onfido_liveness_fetch_challenge_error_title" = "Connection timeout";
"onfido_liveness_fetch_challenge_error_description" = "Check that your connection is stable, then try again";
Expand Down
2 changes: 2 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ The following string keys have been **added**:
- `onfido_liveness_fetch_challenge_error_description`
- `onfido_liveness_fetch_challenge_error_button_title`

The following string keys have been **removed**:
- `onfido_liveness_challenge_open_mouth_title`
## Onfido iOS SDK 12.0.0 Migration Guide

### Breaking API changes
Expand Down
65 changes: 65 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* [UI customisation](#ui-customisation)
* [Localisation](#localisation)
* [Language customisation](#language-customisation)
* [Experimental features](#experimental-features)
* [US Driving License Auto-capture](#us-driving-license-auto-capture)
* [Creating checks](#creating-checks)
* [Going live](#going-live)
* [Migrating](#migrating)
Expand Down Expand Up @@ -93,6 +95,29 @@ lipo -remove i386 Onfido -o Onfido
lipo -remove x86_64 Onfido -o Onfido
```

#### Non-Swift apps

If your app is not Swift based then you must create a new Swift file inside of your project with the following contents:
```
/*
This file is required to force Xcode to package Swift runtime libraries required for
the Onfido iOS SDK to run
*/
import Foundation
import AVFoundation
import CoreImage
import UIKit
import Vision
func fixLibSwiftOnoneSupport() {
// from https://stackoverflow.com/a/54511127/2982993
print("Fixes dyld: Library not loaded: @rpath/libswiftSwiftOnoneSupport.dylib")
}
```
Additionally you must also set `Always Embed Swift Standard Libraries` to `Yes` in your project configuration.

The above code and configuration will force Xcode to package the required Swift runtime libraries required by the Onfido SDK to run.

### 4. Creating an Applicant

You must create an Onfido [applicant](https://documentation.onfido.com/#applicants) before you start the flow.
Expand Down Expand Up @@ -695,6 +720,32 @@ if (variantError) {

You can find the keys for the localizable strings under the example [`Localizable.strings`](Localizable.strings) file in this repo. You can supply partial translations, meaning if you don’t include a translation to particular key our translation will be used instead. You can also name the strings file with the translated keys as you desire but the name of the file will have to be provided to the SDK as a parameter to the `withCustomLocalization()` method i.e. `withCustomLocalization(andTableName: "MY_CUSTOM_STRINGS_FILE")` (`[configBuilder withCustomLocalizationWithTableName:@"MY_CUSTOM_STRINGS_FILE"];` for Objective-C). Addtionally you can specify the bundle from which to read the strings file i.e `withCustomLocalization(andTableName: "MY_CUSTOM_STRINGS_FILE", in: myBundle)` (`[configBuilder withCustomLocalizationWithTableName:@"MY_CUSTOM_STRINGS_FILE" in: myBundle];` for Objective-C).

### Experimental features

**Note** These are experimental features and can be removed in the future without creating a breaking change.

#### US Driving License Auto-capture

You can configure the SDK to auto-capture US driving license when user selects US Driving License or or when you configure the SDK to capture document with the Driving License pre-selected and with document country "USA". This features is only supported on iOS 11+ and iPhone 7 or newer, otherwise defaults to the current document capture flow.

You can configure the SDK to auto-capture US Driving License the following ways:

##### Swift

```swift
let config = try! OnfidoConfig.builder()
.withUSDLAutocapture()
...
.build()
```

##### Objective-C

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

## Creating checks

As the SDK is only responsible for capturing and uploading photos/videos, you would need to start a check on your backend server using the [Onfido API](https://documentation.onfido.com/).
Expand Down Expand Up @@ -737,6 +788,20 @@ A few things to check before you go live:
- Make sure you have set up [webhooks](https://documentation.onfido.com/#webhooks) to receive live events
- Make sure you have entered correct billing details inside your [Onfido Dashboard](https://onfido.com/dashboard/)

### Size Impact

| User iOS Version | SDK Size Impact (MB) |
|------------------|-----------------------------------|
| 12.2 and above | `2.965` |
| Below 12.2 | up to `3.441`* or up to `12.213`** |


**\*** If the application is in Swift but doesn't include any Swift libraries that Onfido iOS SDK requires
**\*\*** If the application doesn't include any Swift code, i.e. written completely in Objective-C, and Onfido iOS SDK is the only
Swift library that application integrates with

**Note**: These calculations was performed based on a single application architecture

## Migrating

You can find the migration guide at [MIGRATION.md](MIGRATION.md) file
Expand Down
1 change: 0 additions & 1 deletion SampleApp/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ target 'SampleApp' do

# Pods for SampleApp
pod 'Onfido'
pod 'Alamofire'
end
2 changes: 0 additions & 2 deletions SampleApp/SampleApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,10 @@
);
inputPaths = (
"${PODS_ROOT}/Target Support Files/Pods-SampleApp/Pods-SampleApp-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
"${PODS_ROOT}/Onfido/Onfido.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Onfido.framework",
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Binary file not shown.

This file was deleted.

60 changes: 31 additions & 29 deletions SampleApp/SampleApp/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import UIKit
import Onfido
import Alamofire

final class ViewController: UIViewController {

Expand Down Expand Up @@ -97,38 +96,41 @@ final class ViewController: UIViewController {
We suggest to create applicants in your backend
*/

let applicant: Parameters = [
"first_name": "Theresa",
"last_name": "May"
]
let defaultSessionConfiguration = URLSessionConfiguration.default
let defaultSession = URLSession(configuration: defaultSessionConfiguration)

let headers: HTTPHeaders = [
"Authorization": "Token token=\(token)",
"Accept": "application/json"
]
let url = URL(string: "https://api.onfido.com/v2/applicants")
var urlRequest = URLRequest(url: url!)

Alamofire.request(
"https://api.onfido.com/v2/applicants",
method: .post,
parameters: applicant,
encoding: JSONEncoding.default,
headers: headers).responseJSON { (response: DataResponse<Any>) in

guard response.error == nil else {
completionHandler(nil, response.error)
return
}

let response = response.result.value as! [String: Any]

guard response.keys.contains("error") == false else {
completionHandler(nil, ApplicantError.apiError(response["error"] as! [String : Any]))
return
let postParams = "first_name=Theresa&last_name=May"
let postData = postParams.data(using: .utf8)

urlRequest.httpMethod = "POST"
urlRequest.httpBody = postData
urlRequest.addValue("Token token=\(token)", forHTTPHeaderField: "Authorization")
urlRequest.addValue("application/json", forHTTPHeaderField: "Accept")

let dataTask = defaultSession.dataTask(with: urlRequest) { (data, response, error) in
let statusCode = (response as? HTTPURLResponse)?.statusCode ?? -1
if statusCode >= 200, statusCode <= 299, let responseData = data {
do {
let json = try JSONSerialization.jsonObject(with: responseData, options: []) as! [String : Any]
guard json.index(forKey: "error") == nil else {
completionHandler(nil, ApplicantError.apiError(json["error"] as! [String : Any]))
return
}
let applicantId = json["id"] as! String
completionHandler(applicantId, nil)
} catch {
completionHandler(nil, ApplicantError.apiError(["exception": error.localizedDescription]))
}
let applicantId = response["id"] as! String
completionHandler(applicantId, nil)
} else {
completionHandler(nil, ApplicantError.apiError(["Http Error": "Response Code: \(statusCode)"]))
}
}

dataTask.resume()

}
}
enum ApplicantError: Error {
Expand Down
1 change: 1 addition & 0 deletions SampleAppObjC/SampleAppObjC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
"${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework",
"${BUILT_PRODUCTS_DIR}/MBProgressHUD/MBProgressHUD.framework",
"${PODS_ROOT}/Onfido/Onfido.framework",
"${PODS_ROOT}/Onfido-Release/Onfido.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
Expand Down
Loading

0 comments on commit b16b915

Please sign in to comment.