iOS SDK

Guide to Integrate Tap2iD iOS SDK

Step-by-step instructions to add the Tap2iD SDK to your iOS project using Swift Package Manager, configure Bluetooth and NFC entitlements, and run your first verification.

Xcode 15.0+
iOS 17.0+
iPhone 11 or newer
Last updated Mar 9, 2026
01
PrerequisitesSystem setup
02
Swift Package ManagerAdd SDK
03
BluetoothInfo.plist keys
04
NFCCapability + plist
05
CompleteStart building
Before you start

System Requirements

Ensure your development environment meets the following requirements before proceeding with the integration.

  • 🍎 Supported iOS Versions: iOS 17.0 and later
  • πŸ”¨ Xcode Version: 15.0 or later
  • πŸ“± Hardware Requirements: iPhone 11 or newer with NFC enabled
01

Swift Package Manager

Add the Tap2iD Verifier SDK to your Xcode project using Swift Package Manager.

1

Open Xcode

Launch your project in Xcode.

2

Add Package Dependency

Go to File β€Ί Add Package Dependencies… and enter the repository URL below.

Swift Package URL
https://github.com/CredenceID/Tap2iD-VerifierSDK-iOS.git
3

Specify Version

Choose Up to Next Major Version and specify X.X.X as the earliest version.

4

Add to Target

Select Tap2iD-VerifierSDK-iOS and add it to your app target.

β„Ή For troubleshooting, refer to Apple's Adding Package Dependencies to Your App documentation.
02

Bluetooth Support

Open your project's Info.plist and add the following Bluetooth usage description keys to enable BLE communication.

⚠ All three Bluetooth keys are required. Apps submitted to the App Store without these descriptions will be rejected.
Info.plist β€” Bluetooth Keys
<key>NSBluetoothAlwaysUsageDescription</key>
<string>Your app requires Bluetooth access to connect to nearby devices even in the background.</string>

<key>NSBluetoothPeripheralUsageDescription</key>
<string>Your app needs to advertise and communicate with other Bluetooth devices.</string>

<key>NSBluetoothWhenInUseUsageDescription</key>
<string>Your app requires Bluetooth access to connect to nearby devices while in use.</string>
03

NFC Support

NFC requires both a capability entitlement in Xcode and additional keys in Info.plist.

Enable NFC Capability

1

Open your project in Xcode

Select your project in the navigator and click your app target.

2

Go to Signing & Capabilities

Select the Signing & Capabilities tab in the target editor.

3

Add Near Field Communication Tag Reading

Click + and search for Near Field Communication Tag Reading, then add it to your target.

Modify Info.plist

Add the NFC usage description and required identifiers to your Info.plist.

Info.plist β€” NFC Keys
<key>NFCReaderUsageDescription</key>
<string>Your app requires NFC access to read mobile identity documents.</string>

<key>com.apple.developer.nfc.readersession.iso7816.select-identifiers</key>
<array>
    <string>D2760000850101</string>
</array>

<key>com.apple.developer.nfc.readersession.felica.systemcodes</key>
<array>
    <string>12FC</string>
</array>
πŸŽ‰
You're all set!
Build and run your project β€” you can now access all Tap2iD iOS SDK APIs in your application.

Example Usage

Swift β€” TestSDK.swift
import Tap2iDVerifierSDK

class TestSDK {

    var delegate: Tap2iDVerifySDKDelegate?

    func initSDK(
        apiKey: String,
        result: @escaping (String?, String?, String?) -> Void
    ) {
        let sdkConfig = CoreSdkConfig(apiKey: apiKey)

        Tap2iDVerifySDK.shared.initSdk(config: sdkConfig) { error, message, profile in
            result(error, message, profile)
        }
    }

    func startQrEngagement(
        capturedQr: String,
        result: @escaping (Error?) -> Void
    ) {
        let error = Tap2iDVerifySDK.shared.verifyMdoc(
            engagementConfig: .qrCode(capturedQr),
            delegate: self
        )
        if let error { result(error) }
    }

    func startPdfEngagement(
        pdf417: String,
        result: @escaping (Error?) -> Void
    ) {
        let error = Tap2iDVerifySDK.shared.verifyMdoc(
            engagementConfig: .pdf417(pdf417),
            delegate: self
        )
        if let error { result(error) }
    }

    func startNativeNfcEngagement(
        result: @escaping (Error?) -> Void
    ) {
        let error = Tap2iDVerifySDK.shared.verifyMdoc(
            engagementConfig: .nfc,
            delegate: self
        )
        if let error { result(error) }
    }

    func startExternalNfcReaderEngagement(
        readerDelegate: NfcExternalReaderDelegate,
        result: @escaping (Error?) -> Void
    ) {
        let error = Tap2iDVerifySDK.shared.verifyMdoc(
            engagementConfig: .nfcExternalReader,
            delegate: self,
            readerDelegate: readerDelegate
        )
        if let error { result(error) }
    }

    func stopMonitoring() {
        Tap2iDVerifySDK.shared.stopMonitoring()
    }
}

Tap2iDVerifySDKDelegate

Swift β€” Verification Delegate
extension TestSDK: Tap2iDVerifySDKDelegate {

    func onVerificationStageStarted(stage: VerificationStage) {
        // Handle verification stage start
    }

    func onVerificationStageError(
        stage: VerificationStage?,
        error: CoreCredenceErrorStruct?
    ) {
        // Handle verification error
    }

    func onVerificationStageCompleted(stage: VerificationStage) {
        // Handle verification stage completion
    }

    func onVerificationCompleted(
        verificationResult: VerificationResult?
    ) {
        // Handle final verification result
    }
}

NfcExternalReaderDelegate

Swift β€” NFC External Reader Delegate
extension TestSDK: NfcExternalReaderDelegate {

    func didDetectReaders() {
        // External NFC reader detected
    }

    func didDisconnectFromReader() {
        // External reader disconnected
    }

    func didDetectSmartCard() {
        // Smart card detected
    }

    func didDisconnectFromSmartCard() {
        // Smart card disconnected
    }
}

Next steps