Skip to content

Quickstart

You need Android Studio or Xcode, the SDK zip, and a phone to run your app on. About an hour.

  1. Add the SDK to your project: in Android Studio, the Maven folder and the two libraries; in Xcode, Wallet.xcframework (Embed & Sign), -lsqlite3 and the compose-resources folder. Step by step: Install & versions.

  2. Create the SDK object once for the process: where credentials come from, and which verifiers to name as trusted.

    WalletSetup.kt
    package samples
    import com.wallet.Wallet
    import com.wallet.WalletSdk
    import com.wallet.config.IssuerConfig
    import com.wallet.config.TrustedVerifiers
    /** The SDK object for a wallet app. Create it once, when the app starts, and keep it. */
    object WalletSetup {
    fun create(signedReaderList: ByteArray): WalletSdk = Wallet.createWallet(
    // Where credentials come from: your OpenID4VCI issuer.
    issuer = IssuerConfig(
    baseUrl = "https://issuer.example.com",
    clientId = "my-wallet",
    redirectUri = "mywallet://callback",
    ),
    // The verifiers named on the consent sheet ("Verify is asking for…"); others show as unknown.
    trustedVerifiers = TrustedVerifiers(signedList = signedReaderList),
    // Document types you hold besides the built-in driving licence.
    credentialTypes = listOf(EmiratesIdType.type),
    // A check before sharing, e.g. the face check (see Prove it's you). Null: share on consent.
    shareGuard = null,
    )
    }
    /** Shared by the samples: the one SDK instance of the app. */
    object App {
    lateinit var sdk: WalletSdk
    }

    Every credential’s key is kept in the phone’s secure hardware (the Android Keystore or the Secure Enclave).

  3. Show the wallet screen. It is the whole holder UI: cards, details, presenting, scanning offers, permissions.

    WalletActivity.kt
    package samples
    import android.os.Bundle
    import androidx.activity.compose.setContent
    import androidx.compose.material3.MaterialTheme
    import androidx.fragment.app.FragmentActivity
    import com.wallet.ui.WalletBranding
    import com.wallet.ui.WalletScreen
    /** The whole wallet UI: the card list, details, presenting, and scanning credential offers. */
    class WalletActivity : FragmentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContent {
    MaterialTheme(typography = WalletBranding.typography) {
    WalletScreen(App.sdk)
    }
    }
    }
    }

    Host it in a FragmentActivity.

  4. Describe your document types. The driving licence is built in. For anything else, a CredentialType gives every field a label, a format and an icon; the wallet, the consent sheet and a verifier’s result screen all use it.

    EmiratesIdType.kt
    package samples
    import com.wallet.model.AttributeKind
    import com.wallet.model.CredentialAttribute
    import com.wallet.model.CredentialNamespace
    import com.wallet.model.CredentialType
    /** A document type: labels, formats and icons for every field. The wallet and the verifier both use it. */
    object EmiratesIdType {
    val type = CredentialType(
    docType = "org.iso.23220.photoid.1",
    displayName = "Emirates ID",
    namespaces = listOf(
    CredentialNamespace(
    "org.iso.23220.1",
    listOf(
    CredentialAttribute("family_name", "Family name", AttributeKind.Text, mandatory = true, icon = "PERSON"),
    CredentialAttribute("given_name", "Given names", AttributeKind.Text, mandatory = true, icon = "PERSON"),
    CredentialAttribute("birth_date", "Date of birth", AttributeKind.Date, icon = "TODAY"),
    CredentialAttribute("sex", "Sex", AttributeKind.Sex),
    CredentialAttribute("portrait", "Photo", AttributeKind.Picture, icon = "ACCOUNT_BOX"),
    CredentialAttribute("expiry_date", "Expiry date", AttributeKind.Date, icon = "EVENT"),
    ),
    ),
    CredentialNamespace(
    "org.iso.23220.photoid.1",
    listOf(CredentialAttribute("person_id", "ID number", AttributeKind.Text, mandatory = true, icon = "BADGE")),
    ),
    ),
    )
    }

    Kinds: Text, Date, DateTime, Picture, Boolean, Number, Sex. Card designs are drawing functions per document type, supplied through a brand pack; document types without one get a neutral card.

  5. Run it on a phone (Android Studio: Run ▶; Xcode: ⌘R): Bluetooth and the camera don’t work in emulators or simulators. Scan a credential offer from your issuer to receive a credential, then present it to the Verify app on a second phone, and open a Hello Mobile link on the same phone.

Next: Hold and show credentials.