Installation
1. Add the pod
Section titled “1. Add the pod”The SDK is distributed from Techsign’s private CocoaPods spec repository on GitHub. Ask your Techsign representative for access, then add the pod to your Podfile:
platform :ios, '13.0'
target 'YourApp' do use_frameworks!
pod 'techsigncloudlibs', '2.9.23-wrapper-suppress-ca', :source => 'https://github.com/Techsign/PODSPECS.git'endpod installFrom now on open the .xcworkspace file, not the .xcodeproj.
2. Add the service client
Section titled “2. Add the service client”ProveIDApiClient is a Swift client for the Prove ID API. Generate it from the OpenAPI definition (download it from the API Reference tab) with OpenAPI Generator:
openapi-generator generate \ -i openapi.json \ -g swift5 \ -o ProveIDApiClient \ --additional-properties=projectName=ProveIDApiClient,library=alamofire,responseAs=ResultAdd the generated folder to your project in Xcode with File → Add Package Dependencies… → Add Local…. It depends on Alamofire 5 and AnyCodable, which Swift Package Manager resolves for you.
3. Permissions
Section titled “3. Permissions”Add the usage descriptions to Info.plist. iOS terminates the app if it accesses the camera or NFC without them.
<key>NSCameraUsageDescription</key><string>The camera is used to scan your ID document and verify your face.</string><key>NFCReaderUsageDescription</key><string>NFC is used to read the chip on your ID document.</string>4. NFC capability
Section titled “4. NFC capability”Only for the NFC step:
- In Xcode, under Signing & Capabilities, add Near Field Communication Tag Reading. This creates the entitlement below.
- Add the application identifier of ID documents (ICAO 9303) to
Info.plist.
<key>com.apple.developer.nfc.readersession.formats</key><array> <string>TAG</string></array><key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key><array> <string>A0000002471001</string></array>Not every device can read NFC. Check before showing the NFC step:
import CoreNFC
let hasNfc = NFCNDEFReaderSession.readingAvailable