Skip to main content
Version: v2

Quick start

This guide shows you how to run a verification in your iOS app with our default screens.

The SDK doesn't create transactions. Your backend creates the transaction with the Agent API, and passes the sdkConfiguration from the response to your app. Your app passes it to the SDK, which runs the verification from there.

Prerequisites​

  • A workflow and its ID.
  • A backend endpoint that creates a transaction with "platform": "Ios" and returns its sdkConfiguration. Read Backend.
  • An app that targets iOS 17.0 or later.

Installation​

Swift Package Manager​

  • Add https://github.com/microblink/microblink-platform-ios.git as a package dependency.
  • Select Exact Version and add the latest released version.
  • Add both MicroblinkPlatform and MicroblinkPlatformEngine to your target.
  • Add the scanner packages, and add their products to your target:
    • BlinkIDVerifyUX from https://github.com/microblink/blinkid-verify-ios, version 4000.0.3.
    • BlinkCardUX from https://github.com/microblink/blinkcard-ios, version 3001.0.2.
  • If your workflow has a face step, also link and embed BiometricsSDK.xcframework and BiometricsEngine.xcframework.

Camera permission​

Add NSCameraUsageDescription to your app's Info.plist, with an explanation of why your app needs the camera, for example to capture documents and selfies.

Integration​

MicroblinkPlatform.view(configuration:onEvent:) returns a SwiftUI view, and reports what happens through a single closure. You present the view, and dismiss it when it's done.

Here's an example SwiftUI integration:

import MicroblinkPlatform
import MicroblinkPlatformEngine
import SwiftUI

struct VerificationButton: View {
// The value your backend got from POST /api/v2/transaction.
let sdkConfiguration: String
@State private var showSDK = false

var body: some View {
Button("Verify your identity") {
showSDK = true
}
.fullScreenCover(isPresented: $showSDK) {
MicroblinkPlatform.view(
configuration: EngineConfiguration(
service: ServiceSettings(sdkConfiguration: sdkConfiguration)
)
) { event in
switch event {
case .finished(let result):
print("Transaction ID:", result.transactionId ?? "none")
print("Outcome:", result.outcome)
showSDK = false
case .canceled(let cancelState):
print("User exited:", cancelState.reason)
showSDK = false
case .cardScanned:
// The verification continues; don't dismiss.
break
@unknown default:
showSDK = false
}
}
}
}
}

In a UIKit app, wrap the view in a UIHostingController; see Integration.


For more information and sample apps, see our iOS GitHub repository.