Skip to main content

AI iOS SDK Upgrade

This guide walks you through upgrading your iOS app from the AutoIdent (AI) SDK to the DocIDV SDK. The start() method works the same way — the main changes are the Swift package, the import name, and a few renamed types.

info
  • The DocIDV SDK is distributed via Swift Package Manager (SPM).
  • The SDK is named DocIDV and the initial release version is 1.1.0.
  • The release supports the following variants: DocIDV and EID-Governikus.

What has changed

Import and entry point

The module name and the main SDK class have been renamed.

AI SDKDocIDV SDK
Importimport IDnowSdkCoreimport DocIDV
Entry pointIDnowSDKIDnowDocIDV

Some parameters of the start() method changed.

AI SDKDocIDV SDK
tokentoken
isRoutedSessionisRoutedSession
preferredLanguagepreferredLanguage
bindingKeybindingKey
fromViewControllerviewController
listenerNo more existing. The start method is now async throws

Before and after

Before (AI SDK)

import IDnowSdkCore

IDnowSDK.shared.start(
token: "YOUR_TOKEN",
fromViewController: self,
listener: { result, statusCode, message in
switch result {
case .FINISHED:
// success
case .CANCELLED:
// cancelled
case .ERROR:
// error
default:
break
}
}
)

After (DocIDV SDK)

import DocIDV

do {
try await IDnowDocIDV.shared.start(
token: "YOUR_TOKEN",
viewController: viewController)
// Handle success
} catch let error {
// Handle errors
}

Upgrade steps

1. Update the Swift Package

In Xcode, update your existing AutoIdent SPM dependency to point to the DocIDV repository:

https://github.com/idnow/docidv-sdk-ios

2. Update your import statements

Replace import IDnowSdkCore with import DocIDV in any file that references the SDK.

3. Update start method

Use the new async start method, and call your existing methods to handle the result.

import DocIDV

do {
try await IDnowDocIDV.shared.start(
token: "YOUR_TOKEN",
viewController: viewController)
handleSuccess()
} catch let error {
switch error {
case .cancelled(let reason, let message): handleCancellation(message: message)
case .token(let tokenError, let message): handleTokenError()
case .network(let networkError, let message): handleNetworkError()
case .internalError(let statusCode, let message): handleError(statusCode: statusCode, message: message)
}
}

4. Build and run

Compile and run the project to verify the upgrade.

tip

For full SDK configuration options and API reference, see the iOS SDK documentation.