Skip to content

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.

  1. 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
    }
  2. Create the SDK object once, with the issuers you trust and the certificate you sign requests with.

    VerifierSetup.kt
    package samples
    import com.wallet.Wallet
    import com.wallet.WalletSdk
    import com.wallet.config.IssuerDisplayName
    import com.wallet.config.ReaderIdentityConfig
    import 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 provider
    issuerRootPem: String, // one issuer's root certificate, to name it on the result
    readerKeyBase64: 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),
    )
    }
  3. 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 samples
    import android.os.Bundle
    import androidx.activity.compose.setContent
    import androidx.fragment.app.FragmentActivity
    import com.wallet.model.RequestPresets
    import 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 ID
    title = "Verify",
    )
    }
    }
    }

    Host it in a FragmentActivity.

  4. 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.