Skip to main content

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:
With Swift Package Manager in Xcode, choose File → Add Package Dependencies, enter 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.
  1. Enable NFC in the Apple Developer portal. Under Certificates, Identifiers & Profiles → Identifiers, select your App Identifier and turn on NFC Tag Reading.
  2. Add the capability in Xcode. In your app target, open Signing & Capabilities, click + Capability and add Near Field Communication Tag Reading.
  3. Enable the PACE and TAG formats in your target’s .entitlements file:
    Entitlements
  4. Add the usage description to Info.plist, with a text the applicant sees:
    Info.plist
  5. Add the ISO 7816 select identifiers to Info.plist: A0000002471001 for passports and A00000045645444C2D3031 for ID cards and driving licences.
    Info.plist
The NFC step is enabled per flow in the Backoffice: Flows → [flow name] → Customize → NFC. NFC needs a physical device. See NFC chip reading.

Start the flow

Call startVerificationFlow from a user action, such as a button handler.
Swift

Options

OptionTypeDescription
apiUrl requiredStringEnvironment 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 requiredStringFlow name from the Backoffice
localeStringLanguage code, for example en, de or ar_SA. Overrides the device language. See Localization for all codes.
dictionaryStringName of a custom translation dictionary. See Localization.
metadataGetIDMetadataexternalId: 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.
addressGetIDAddressExpected 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.
Pass 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

Set GetIDSDK.delegate and conform to GetIDSDKDelegate.
CallbackReceivesCalled when
verificationFlowStartNothingThe flow has started
verificationFlowDidCompleteGetIDApplication with applicationIdThe applicant has submitted everything
verificationFlowDidCancelNothingThe applicant cancelled the flow
verificationFlowDidFailGetIDErrorThe flow can’t continue. See Errors.
The SDK doesn’t return verification results. Get them on your server by webhook or API.

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