CredflareDevelopersOpen dashboard
Preview

Swift SDK

A SwiftUI flow for iOS 16 and newer that collects the requested documents, runs the liveness challenge and location step, and sends the evidence for review.

Not published as a versioned release. The source is on GitHub at credflare/swift-sdk. Add it as a Swift package dependency and select the CredflareSDK product. It has no external runtime dependencies.

Add the guided flow

import CredflareSDK

CredflareVerificationView(sessionProvider: {
    try await yourBackend.createApplicantSession() // returns SessionDescriptor
}, autoStart: true) { result in
    switch result {
    case .submitted: refreshStatus()
    case .hostActionRequired: showYourOwnSteps()
    case .cancelled: dismiss()
    }
}

SessionDescriptor decodes the session JSON your backend returns, as shown in the server example. It rejects a non-HTTPS API URL outside localhost.

ResultMeaning
.submittedNothing is left to collect. This is a receipt, not a decision.
.hostActionRequired(code:)The SDK collected what it can, but the case still needs something your app handles. code is the rejection code when the applicant left from a leave rejection, such as phone.not_configured, and nil when questions or checks the SDK does not collect remain.
.cancelledThe applicant closed the flow. The case stays open.

Present the view in a sheet or full-screen cover. Its Close control reports .cancelled. The view asks the questions and collects the documents, then runs the case's facial, location, email and phone requirements in profile order before the receipt.

Liveness and location

Questions and codes

Not yet on production: questions, email and phone codes, fetching the session after each submit, rejection screens with a help contact. They need API and SDK versions that are not released yet.

Build your own screens

VerificationSession offers async get(), upload(), submit(), createLivenessChallenge(), uploadBiometric(), submitFacial(), submitLocation(), requestCode(), confirmCode(), submitAnswers(), refresh(), replaceSession() and cancel(). Uploads and submissions take a UUID retry key. Reuse the key with the same evidence after a network failure.

Configure the app

Read how the SDKs work for capture methods, receipts and error handling.