Quickstart
You need Android Studio or Xcode, the SDK zip, a phone to run your app on, and a second phone with the demo wallet. About an hour.
-
Add the SDK to your project, as in Install & versions:
In Android Studio, point Gradle at the Maven folder from the zip, add the two libraries to
app/build.gradle.kts, and click Sync Now:dependencies {implementation("com.wallet.sdk:sdk-core:0.7.0")implementation("com.wallet.sdk:sdk-ui-compose:0.7.0")implementation("androidx.activity:activity-compose:1.12.0")implementation("androidx.fragment:fragment-ktx:1.8.5") // the screen is hosted in a FragmentActivity}In Xcode, drag
ios/Wallet.xcframeworkinto the project (Embed & Sign), add-lsqlite3to Other Linker Flags, drag inios/compose-resourcesas a folder reference, and add the camera and Bluetooth usage descriptions to the Info tab. -
Create the SDK object once, with the issuers you trust and the certificate you sign requests with.
VerifierSetup.kt package samplesimport com.wallet.Walletimport com.wallet.WalletSdkimport com.wallet.config.IssuerDisplayNameimport com.wallet.config.ReaderIdentityConfigimport com.wallet.config.TrustedIssuers/** The SDK object for a verifier app. Create it once, when the app starts, and keep it. */object VerifierSetup {fun create(signedIssuerList: ByteArray, // the signed list of issuers you accept, from your trust providerissuerRootPem: String, // one issuer's root certificate, to name it on the resultreaderKeyBase64: String, // your reader key (we issue it for pilots)readerCertChainPem: List<String>, // your reader certificate chain, leaf first): WalletSdk = Wallet.createVerifier(// Accept credentials from the issuers on the list, and show "Issued by Road Transport Authority".trustedIssuers = TrustedIssuers(signedList = signedIssuerList,displayNames = listOf(IssuerDisplayName(issuerRootPem, "Road Transport Authority")),),// Sign every request, so wallets show your name instead of "unknown verifier".readerIdentity = ReaderIdentityConfig(privateKeyBase64 = readerKeyBase64, certChainPem = readerCertChainPem),// Document types you check besides the built-in driving licence.credentialTypes = listOf(EmiratesIdType.type),)}Verifier.swift import Foundationimport Wallet/// The SDK object for a verifier app. Created once, when the app starts, and kept.enum Verifier {static let sdk: WalletSdk = Wallet.shared.createVerifier(// Accept credentials from the issuers on the list, and show "Issued by Road Transport Authority".trustedIssuers: TrustedIssuers(signedList: Trust.signedIssuerList,displayNames: [IssuerDisplayName(certificatePem: Trust.issuerRootPem, displayName: "Road Transport Authority")]),// Sign every request, so wallets show your name instead of "unknown verifier".readerIdentity: ReaderIdentityConfig(privateKeyBase64: Trust.readerKeyBase64, certChainPem: Trust.readerCertChainPem),// Document types you check besides the built-in driving licence.credentialTypes: [EmiratesIdType.type])}/// Your trust material, from your app's resources or your server.enum Trust {static let signedIssuerList = KotlinByteArray(size: 0) // the signed list of issuers you acceptstatic let issuerRootPem = "" // one issuer's root certificate (PEM)static let readerKeyBase64 = "" // your reader key (we issue it for pilots)static let readerCertChainPem: [String] = [] // your reader certificate chain, leaf first} -
Show the screen. It handles the camera and Bluetooth permissions (with an explanation page before the system dialogs), the scanner, the connection and the result view.
VerifierActivity.kt package samplesimport android.os.Bundleimport androidx.activity.compose.setContentimport androidx.fragment.app.FragmentActivityimport com.wallet.model.RequestPresetsimport com.wallet.ui.WalletVerifyScreen/** The whole in-person verifier: pick a check, scan, read the result. Permissions are handled inside. */class VerifierActivity : FragmentActivity() {override fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState)setContent {WalletVerifyScreen(sdk = App.sdk,presets = RequestPresets.mdl + Checks.emiratesId, // in this order: driving licence, Emirates IDtitle = "Verify",)}}}Host it in a
FragmentActivity.VerifierApp.swift import SwiftUIimport Wallet/// The whole in-person verifier: pick a check, scan, read the result. Permissions are handled inside.@mainstruct VerifierApp: App {var body: some Scene {WindowGroup { VerifyScreen().ignoresSafeArea() }}}/// The SDK's verify screen, hosted in SwiftUI.struct VerifyScreen: UIViewControllerRepresentable {func makeUIViewController(context: Context) -> UIViewController {WalletViewControllersKt.WalletVerifyViewController(sdk: Verifier.sdk,presets: RequestPresets.shared.mdl + Checks.emiratesId, // in this order: driving licence, Emirates IDtitle: "Verify")}func updateUIViewController(_ controller: UIViewController, context: Context) {}}The screen is a
UIViewController; in SwiftUI, wrap it in aUIViewControllerRepresentable. -
Run it on a phone (Android Studio: pick the phone and press Run ▶; Xcode: pick the iPhone and press ⌘R). Bluetooth and the camera don’t work in emulators or simulators. With the demo wallet on the second phone: pick “Licence check”, scan the wallet’s QR (its Present button shows it), approve on the wallet, and read the result.
Next: Define your checks.