DOT iOS NFC 9.0.0
This guide describes how to migrate DOT iOS NFC version 8.x to version 9.0. Only the most important changes are highlighted in this guide. For more details, see the iOS Samples.
Migration Steps
Compatibility with DIS
When utilizing DIS for server-side evaluation, ensure compatibility between your DIS version and the corresponding SDK version. Refer to the DIS vs SDKs compatibility table for detailed compatibility information.
Deployment
Changed minimal required iOS version to iOS 13.0. Changed minimal required Xcode version to Xcode 16.1.
SDK initialization
The way DOT SDK libraries are configured has changed.
- Replace
DotSdkConfigurationwithDotSdk.Configurationclass. - Update
librariesproperty ofDotSdk.Configurationclass.
Before
Libraries were provided as a list of DotLibrary instances.
let dotSdkConfiguration = DotSdkConfiguration(
license: Data,
libraries: [DotNfcLibrary()]
)
try DotSdk.shared.initialize(configuration: dotSdkConfiguration)
After
Libraries are now configured via a single Libraries object, with explicit configuration for each DOT SDK library.
let dotSdkConfiguration = DotSdk.Configuration(
licenseBytes: license,
libraries: .init(
nfc: DotNfcLibraryConfiguration()
)
)
try DotSdk.shared.initialize(configuration: dotSdkConfiguration)
UI NFC Travel Document Reader
The configuration structure of the NfcTravelDocumentReader has changed. Existing configuration objects are not compatible with the new API and must be migrated to the new configuration model.
Before
let configuration = NfcTravelDocumentReader.Configuration(
sessionToken: "...",
authorityCertificatesUrl: URL? = nil,
pollingOption: PollingOption = .standard,
_debugInfoEnabled: Bool = false
)
let travelDocumentReader = NfcTravelDocumentReader(configuration: configuration)
After
let configuration = NfcTravelDocumentReader.Configuration(
common: CommonConfiguration = .init(sessionToken: "..."),
authorityCertificatesUrl: URL? = nil,
pollingOption: PollingOption = .standard,
_debugInfoEnabled: Bool = false
)
let travelDocumentReader = NfcTravelDocumentReader(configuration: configuration)
NFC Travel Document Reader
Basic migration steps:
- Read errors thrown by
NfcTravelDocumentReader.read(...)methods are now defined asNfcTravelDocumentReader.Error.ReadError. Update all error handling to use this new inner error type. - Replace all
NfcTravelDocumentReader.read(...)methods that previously accepted anNfcKeyargument with the new methods that accept aPasswordinstead.
Before
let reader = NfcTravelDocumentReader(
configuration: .init(
//...
)
)
let nfcKey = NfcKey(
documentNumber: "...",
dateOfExpiry: "...",
dateOfBirth: "..."
)
do {
try reader.read(tag: tag, nfcKey: nfcKey)
} catch let error as NfcTravelDocumentReader.AccessControlError {
//...
} catch let error as NfcTravelDocumentReader.ChipAuthenticationError {
//...
} catch let error as NfcTravelDocumentReader.NotConnectedError {
//...
} catch let error as NfcTravelDocumentReader.Error {
//...
}
After
let reader = NfcTravelDocumentReaderFactory.create(
configuration: NfcTravelDocumentReader.Configuration(
//...
)
)
let password = Password.MachineReadableZone(
documentNumber: "...",
dateOfExpiry: "...",
dateOfBirth: "..."
)
do {
try reader.read(tag: tag, password: password)
} catch let error as NfcTravelDocumentReader.AccessControlError {
//...
} catch let error as NfcTravelDocumentReader.ChipAuthenticationError {
//...
} catch let error as NfcTravelDocumentReader.NotConnectedError {
//...
} catch let error as NfcTravelDocumentReader.ReadError {
//...
} catch let error as NfcTravelDocumentReader.Error {
//...
}