To add our SDK to your own application, you should add it to the build process of your application. Currently we support doing this using CocoaPods or Carthage.
To add the repository to your project, open the Podfile, if it does not exists,
first run pod init in the root of your project with Xcode closed.
Edit the target part of your application in the Podfile, so that it contains the
following:
pod 'Klippa-Identity-Verification', podspec: 'https://custom-ocr.klippa.com/sdk/ios/specrepo/ExampleUsername/ExamplePassword/KlippaIdentityVerification/latest.podspec'
The full Podfile might look like this now:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'TestIdentityVerification' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for TestIdentityVerification
pod 'Klippa-Identity-Verification', podspec: 'https://custom-ocr.klippa.com/sdk/ios/specrepo/ExampleUsername/ExamplePassword/KlippaIdentityVerification/latest.podspec'
end
When you run pod install now, it should download our library as dependency, and with that all
dependencies of our library.
Note: this code always uses the latest version, you can also use a specific
version to make sure the SDK won't update without your knowledge.
To add the repository to your project, open the Cartfile, if it does not exists,
create a Cartfile alongside your .xcodeproj or .xcworkspace.
Add the following to your Cartfile:
binary "https://custom-ocr.klippa.com/sdk/ios/carthage/ExampleUsername/ExamplePassword/KlippaIdentityVerification.json"
When you run carthage update now, it should download our library as dependency, and with that
all dependencies of our library.
Note: this code always uses the latest version, you can also use a specific
version to make sure the SDK won't update without your knowledge.
If you want to use the NFC capabilities inside of the Identity SDK please add the following to your
Info.plist
.
<key>NFCReaderUsageDescription</key>
<string>Your NFC usage description here.</string>
<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
<string>A0000002471001</string>
<string>A0000002472001</string>
<string>00000000000000</string>
</array>
Also, add "Near Field Communication Tag Reading" capability to your app using the Signing & Capabilities pane of the project editor.
Before you can start using the identity verification you need to generate a session token in your backend. You can then start the session using your newly generated token. Once the session has been completed you can collect the files and data read by the OCR.
In the ViewController that you want to launch the identity verification, implement the IdentityBuilderDelegate:
// Add to the top of your file
import KlippaIdentityVerification
// Your class definition should look like this.
final class ExampleIdentityVerificationViewController: UIViewController, IdentityBuilderDelegate {
// ... Rest of your controller code.
func startIdentityVerification() {
// @todo: get a session token from the API through your backend here.
let builder = IdentityBuilder(builderDelegate: self, sessionKey: "{insert-session-token-here}")
// Build returns a viewController UIViewController that you can present.
let viewController = builder.build()
self.present(viewController, animated: true, completion: nil)
}
func finishedWithSuccess(response: KIVResult) {
print("finishedWithSuccess")
}
func canceled() {
print("canceled")
}
func contactSupportPressed() {
print("contactSupportPressed")
}
// ... Rest of your controller code.
}
// Add to the top of your file
#import
@interface ViewController ()
@end
// Your class definition should look like this.
@implementation ViewController
// ... Rest of your controller code.
- (IBAction)ButtonClick:(id)sender {
[self startIdentityVerification];
}
- (void)startIdentityVerification {
id builder = [[IdentityBuilder alloc] initWithBuilderDelegate:self sessionKey:@"{insert-token}"];
// Build returns a viewController UIViewController that you can present.
id viewController = [builder build];
[self presentViewController:viewController animated:true completion:nil];
}
- (void)canceled {
NSLog(@"canceled");
}
- (void)finishedWithSuccessWithResponse:(KIVResult * _Nonnull)response {
NSLog(@"finishedWithSuccess");
}
- (void)contactSupportPressed {
NSLog(@"contactSupportPressed");
}
// ... Rest of your controller code.
}
In the place where you want to start the identity verification, for example after a button click, call the startIdentityVerification method:
startIdentityVerification()
The SDK has a few customizing settings, the following methods are available:
builder.hasIntroScreen = true
builder.hasSuccessScreen = true
builder.kivColors.textColor = UIColor.red
builder.kivColors.backgroundColor = UIColor.lightGray
builder.kivColors.buttonSuccessColor = UIColor.purple
builder.kivColors.buttonErrorColor = UIColor.red
builder.kivColors.buttonOtherColor = UIColor.lightGray
builder.kivColors.progressBarBackground = UIColor.lightGray
builder.kivColors.progressBarForeground = UIColor.orange
builder.kivFonts.fontName = "ComicSans"
builder.kivFonts.boldFontName = "ComicSans"
// We support English, Dutch and Spanish.
builder.kivLanguage = .Dutch
// The extracted data keys that will be shown to the user after document pictures are processed.
Default value:
builder.kivVerifyIncludeList = [
"DateOfBirth",
"DateOfIssue",
"DocumentNumber",
"DocumentSubtype",
"DocumentType",
"Face",
"Gender",
"GivenNames",
"Height",
"IssuingCountry",
"IssuingInstitution",
"Nationality",
"PersonalNumber",
"PlaceOfBirth",
"Residency",
"Signature",
"Surname"
]
// The extracted data keys that will be hidden for the user after document pictures are processed.
Default value (empty):
builder.kivVerifyExcludeList = []
[builder setHasIntroScreen:true];
[builder setHasSuccessScreen:true];
[[builder kivColors] setTextColor: UIColor.redColor];
[[builder kivColors] setBackgroundColor: UIColor.lightGrayColor];
[[builder kivColors] setButtonSuccessColor: UIColor.purpleColor];
[[builder kivColors] setButtonErrorColor: UIColor.redColor];
[[builder kivColors] setButtonOtherColor: UIColor.lightGrayColor];
[[builder kivColors] setProgressBarBackground: UIColor.lightGrayColor];
[[builder kivColors] setProgressBarForeground: UIColor.orangeColor];
[[builder kivFonts] setFontName: @"ComicSans"];
[[builder kivFonts] setBoldFontName: @"ComicSans"];
// We support English, Dutch and Spanish.
[builder setKivLanguage:IdentityBuilderKIVLanguageDutch];
// The extracted data keys that will be shown to the user after document pictures are processed.
// Default value:
NSArray *kivVerifyIncludeList = @[
@"DateOfBirth",
@"DateOfIssue",
@"DocumentNumber",
@"DocumentSubtype",
@"DocumentType"
@"Face"
@"Gender"
@"GivenNames"
@"Height"
@"IssuingCountry"
@"IssuingInstitution"
@"Nationality"
@"PersonalNumber"
@"PlaceOfBirth"
@"Residency"
@"Signature"
@"Surname"];
[builder setKivVerifyIncludeList: kivVerifyIncludeList];
// The extracted data keys that will be hidden for the user after document pictures are processed.
// Default value (empty):
NSMutableArray *setKivVerifyExcludeList = [NSMutableArray new];
[builder setKivVerifyExcludeList: setKivVerifyExcludeList];
The dependency download size itself is 67.3MB when extracted, but it contains builds for multiple architectures, it depends on the architecture of the phone how much the SDK is going to add to the app size:
The following versions are available:
Version | Podspec include URL | Cartfile dependency | Binary download |
---|---|---|---|
0.5.9 | https://custom-ocr.klippa.com/sdk/ios/specrepo/ExampleUsername/ExamplePassword/KlippaIdentityVerification/0.5.9.podspec | binary "https://custom-ocr.klippa.com/sdk/ios/carthage/ExampleUsername/ExamplePassword/KlippaIdentityVerification.json" == 0.5.9 | Fat framework (.xcarchive) | XCFramework |
0.5.8 | https://custom-ocr.klippa.com/sdk/ios/specrepo/ExampleUsername/ExamplePassword/KlippaIdentityVerification/0.5.8.podspec | binary "https://custom-ocr.klippa.com/sdk/ios/carthage/ExampleUsername/ExamplePassword/KlippaIdentityVerification.json" == 0.5.8 | Fat framework (.xcarchive) | XCFramework |
0.5.7 | https://custom-ocr.klippa.com/sdk/ios/specrepo/ExampleUsername/ExamplePassword/KlippaIdentityVerification/0.5.7.podspec | binary "https://custom-ocr.klippa.com/sdk/ios/carthage/ExampleUsername/ExamplePassword/KlippaIdentityVerification.json" == 0.5.7 | Fat framework (.xcarchive) | XCFramework |
0.5.6 | https://custom-ocr.klippa.com/sdk/ios/specrepo/ExampleUsername/ExamplePassword/KlippaIdentityVerification/0.5.6.podspec | binary "https://custom-ocr.klippa.com/sdk/ios/carthage/ExampleUsername/ExamplePassword/KlippaIdentityVerification.json" == 0.5.6 | Fat framework (.xcarchive) | XCFramework |
0.5.5 | https://custom-ocr.klippa.com/sdk/ios/specrepo/ExampleUsername/ExamplePassword/KlippaIdentityVerification/0.5.5.podspec | binary "https://custom-ocr.klippa.com/sdk/ios/carthage/ExampleUsername/ExamplePassword/KlippaIdentityVerification.json" == 0.5.5 | Fat framework (.xcarchive) | XCFramework |
0.5.4 | https://custom-ocr.klippa.com/sdk/ios/specrepo/ExampleUsername/ExamplePassword/KlippaIdentityVerification/0.5.4.podspec | binary "https://custom-ocr.klippa.com/sdk/ios/carthage/ExampleUsername/ExamplePassword/KlippaIdentityVerification.json" == 0.5.4 | Fat framework (.xcarchive) | XCFramework |
0.5.3 | https://custom-ocr.klippa.com/sdk/ios/specrepo/ExampleUsername/ExamplePassword/KlippaIdentityVerification/0.5.3.podspec | binary "https://custom-ocr.klippa.com/sdk/ios/carthage/ExampleUsername/ExamplePassword/KlippaIdentityVerification.json" == 0.5.3 | Fat framework (.xcarchive) | XCFramework |
0.5.2 | https://custom-ocr.klippa.com/sdk/ios/specrepo/ExampleUsername/ExamplePassword/KlippaIdentityVerification/0.5.2.podspec | binary "https://custom-ocr.klippa.com/sdk/ios/carthage/ExampleUsername/ExamplePassword/KlippaIdentityVerification.json" == 0.5.2 | Fat framework (.xcarchive) | XCFramework |
0.5.1 | https://custom-ocr.klippa.com/sdk/ios/specrepo/ExampleUsername/ExamplePassword/KlippaIdentityVerification/0.5.1.podspec | binary "https://custom-ocr.klippa.com/sdk/ios/carthage/ExampleUsername/ExamplePassword/KlippaIdentityVerification.json" == 0.5.1 | Fat framework (.xcarchive) | XCFramework |
0.5.0 | https://custom-ocr.klippa.com/sdk/ios/specrepo/ExampleUsername/ExamplePassword/KlippaIdentityVerification/0.5.0.podspec | binary "https://custom-ocr.klippa.com/sdk/ios/carthage/ExampleUsername/ExamplePassword/KlippaIdentityVerification.json" == 0.5.0 | Fat framework (.xcarchive) | XCFramework |
0.4.0 | https://custom-ocr.klippa.com/sdk/ios/specrepo/ExampleUsername/ExamplePassword/KlippaIdentityVerification/0.4.0.podspec | binary "https://custom-ocr.klippa.com/sdk/ios/carthage/ExampleUsername/ExamplePassword/KlippaIdentityVerification.json" == 0.4.0 | Fat framework (.xcarchive) | XCFramework |
0.3.0 | https://custom-ocr.klippa.com/sdk/ios/specrepo/ExampleUsername/ExamplePassword/KlippaIdentityVerification/0.3.0.podspec | binary "https://custom-ocr.klippa.com/sdk/ios/carthage/ExampleUsername/ExamplePassword/KlippaIdentityVerification.json" == 0.3.0 | Fat framework (.xcarchive) | XCFramework |
0.2.0 | https://custom-ocr.klippa.com/sdk/ios/specrepo/ExampleUsername/ExamplePassword/KlippaIdentityVerification/0.2.0.podspec | binary "https://custom-ocr.klippa.com/sdk/ios/carthage/ExampleUsername/ExamplePassword/KlippaIdentityVerification.json" == 0.2.0 | Fat framework (.xcarchive) | XCFramework |
0.1.1 | https://custom-ocr.klippa.com/sdk/ios/specrepo/ExampleUsername/ExamplePassword/KlippaIdentityVerification/0.1.1.podspec | binary "https://custom-ocr.klippa.com/sdk/ios/carthage/ExampleUsername/ExamplePassword/KlippaIdentityVerification.json" == 0.1.1 | Fat framework (.xcarchive) | XCFramework |
0.1.0 | https://custom-ocr.klippa.com/sdk/ios/specrepo/ExampleUsername/ExamplePassword/KlippaIdentityVerification/0.1.0.podspec | binary "https://custom-ocr.klippa.com/sdk/ios/carthage/ExampleUsername/ExamplePassword/KlippaIdentityVerification.json" == 0.1.0 | Fat framework (.xcarchive) | XCFramework |
0.0.7 | https://custom-ocr.klippa.com/sdk/ios/specrepo/ExampleUsername/ExamplePassword/KlippaIdentityVerification/0.0.7.podspec | binary "https://custom-ocr.klippa.com/sdk/ios/carthage/ExampleUsername/ExamplePassword/KlippaIdentityVerification.json" == 0.0.7 | Fat framework (.xcarchive) | XCFramework |
textColor
was not being set correctly on some textFields
.InsufficientPermission
error if camera permissions were denied or are restricted.RequiredLivenessCount
to 0.MatchDocumentSides
was set to true.RequiredNFCScanCount
to 1.iOS 13.0
finishedWithSuccess(response:)
to identityVerificationFinished()
.canceled()
to identityVerificationCanceled(withError:)
.contactSupportPressed()
to identityVerificationContactSupportPressed()
.builder.isDebug = true
). Please note that due to this change you will have also have to call the production API (https://custom-ocr.klippa.com) from your backend.contactSupportPressed()
builder.kivVerifyIncludeList
and builder.kivVerifyExcludeList