Requirements
This guide covers SDK version 4.2.3. NFC chip reading needs 4.1.1 or newer.
Install
Add the SDK with CocoaPods, Carthage or Swift Package Manager:https://github.com/vvorld/getid-ios-sdk, and set the version to 4.2.3 or above.
If you hit build issues, disable User Script Sandboxing in build settings. Objective-C apps must set Always Embed Swift Standard Libraries to YES.
Info.plist
NFC
Only needed if the flow uses NFC.- Enable NFC in the Apple Developer portal. Under Certificates, Identifiers & Profiles → Identifiers, select your App Identifier and turn on NFC Tag Reading.
- Add the capability in Xcode. In your app target, open Signing & Capabilities, click + Capability and add Near Field Communication Tag Reading.
- Enable the PACE and TAG formats in your target’s
.entitlementsfile:Entitlements - Add the usage description to
Info.plist, with a text the applicant sees:Info.plist - Add the ISO 7816 select identifiers to
Info.plist:A0000002471001for passports andA00000045645444C2D3031for ID cards and driving licences.Info.plist
Start the flow
CallstartVerificationFlow from a user action, such as a button handler.
Swift
Options
| Option | Type | Description |
|---|---|---|
apiUrl required | String | Environment URL, for example https://partner.sb.getid.dev or https://partner.getid.ee |
auth required | .jwt or .sdkKey | .jwt("JWT") with a session token from POST /sdk/v2/token. During development, .sdkKey("SDK_KEY") works instead; don’t ship the SDK key in production apps. .sdkKey also takes an optional customer ID: .sdkKey("SDK_KEY", customerId: "CUSTOMER_ID"). |
flowName required | String | Flow name from the Backoffice |
locale | String | Language code, for example en, de or ar_SA. Overrides the device language. See Localization for all codes. |
dictionary | String | Name of a custom translation dictionary. See Localization. |
metadata | GetIDMetadata | externalId: your customer or session ID, not unique. labels: up to 30 string key-value pairs. |
profileData | [String: String] | Known applicant data as key-value pairs, for example first-name, for cross-checking and prefilling. See Profile data keys. |
address | GetIDAddress | Expected address for Proof of Address: country (ISO alpha-3), city, postcode, addressLine, streetName, houseNumber. |
acceptableDocuments | [GetIDAcceptableDocuments.Country: [GetIDDocumentType]] | Narrows the flow’s accepted documents for this session. Maps ISO alpha-3 country codes to document types, for example .passport and .idCard, with a .default key. See Accepted documents per session. |
profileData and acceptableDocuments with .init(...), as in the full example.
Profile data keys
profileData keys match field types in the flow, for example first-name. If the flow has a Profile Data step with a field of the same type, the value prefills that field.
Supported keys:
first-name, last-name, date-of-birth, gender, nationality, personal-number, document-number, date-of-issue, date-of-expiry, email, phone-number, address, postcode, city-of-residence, country-of-residence.
Dates are YYYY-MM-DD, gender is male or female, and countries are ISO alpha-3.
Callbacks
SetGetIDSDK.delegate and conform to GetIDSDKDelegate.
| Callback | Receives | Called when |
|---|---|---|
verificationFlowStart | Nothing | The flow has started |
verificationFlowDidComplete | GetIDApplication with applicationId | The applicant has submitted everything |
verificationFlowDidCancel | Nothing | The applicant cancelled the flow |
verificationFlowDidFail | GetIDError | The flow can’t continue. See Errors. |
Errors
verificationFlowDidFail receives GetIDError.initializationError before any SDK screen is shown, or GetIDError.flowError after the SDK has closed its UI. Read error.localizedDescription when logging.
GetIDError.InitializationError
GetIDError.FlowError
Full example
Swift