> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/nfc-wallet-sdk-ios/implement-nfc-wallet/manage-digital-cards/display-digital-cards.md).

# Display digital cards

## Overview

After **Tokenization**, your **digital wallet application** should show the **end user** their digital cards.

Provide a list view and a details view. Use card state, card art, and metadata to drive the UI.

## SDK Integration

### Retrieve card list

After digitization completes, the digital wallet application can retrieve and display digital cards.

Use `DigitalCardManager.cardList` to retrieve the list of all digitized cards.

<pre class="language-swift" data-title="List digital cards"><code class="lang-swift">func retrieveCardList() async {
  let manager = DigitalCardManager()
  do {
    let cardList = try await manager.cardList
    // Use cardList to populate your UI.
  } catch {
<strong>    // Handle errors.
</strong>  }
}
</code></pre>

### Retrieve a digital card

You can retrieve a `DigitalCard` from `DigitalCardManager` in several ways:

{% code title="Get a digital card" %}

```swift
func getDigitalCards() async throws {
  let manager = DigitalCardManager()

  // Get the full list once, then access elements locally.
  let cardList = try await manager.cardList

  // Get the card designated as the default card.
  let defaultCard = try await manager.defaultCard

  // Get the first card in the list.
  let firstCard = cardList.first

  // Get the last card in the list.
  let lastCard = cardList.last

  // Retrieve the card at a specific index.
  // Accessing an out-of-range index will crash, so validate first.
  let index = 0
  guard cardList.indices.contains(index) else { return }
  let cardAtIndex = cardList[index]

  // Retrieve the last card using the list count.
  let cardCount = cardList.count
  let lastCardByIndex = cardList[cardCount - 1]

  // Retrieve the card with a specific digitalCardID.
  let digitalCardID = ""
  let specificCard = await manager.digitalCard(forID: digitalCardID)
}
```

{% endcode %}

### Get card details

A `DigitalCard` represents a digitized card. It exposes the data needed to build your UI and manage the card lifecycle:

* `DigitalCard.State`: Digital card state
* `DigitalCard.CardArt`: Card art data
* `DigitalCard.CardMetadata`: Card metadata, including:
  * Last four digits of the PAN
  * Last four digits of the token
  * PAN expiry date
* `DigitalCard.PaymentKeyInfo`: Payment key information, including:
  * Number of remaining payments
  * Whether replenishment is required
  * Payment key type
  * Payment key expiry date/time
* `DigitalCard.Details`: Card scheme and capabilities, including:
  * `scheme`: Payment scheme (Visa, Mastercard, or PURE)
  * `paymentTypesSupported`: Supported payment channels

The following example shows how to retrieve digital card details:

{% code title="Get digital card details" %}

```swift
func retrieveCardDetails(digitalCard: DigitalCard) async {
  do {
    // card states: .active, .suspended, .inactive, etc.
    // .active cards can be used for payment
    // .suspended cards require activation in order to perform payment
    // .inactive cards imply that the initial ID&V has not completed.
    // Use pendingActivationSession to resume ID&V.
    // other cases, card is not in use
    let cardState = try await digitalCard.state

    // card art retrieval
    let cardArt = try await digitalCard.cardArt
    let bitmap = try await cardArt.bitmap(forArtType: .cardBackgroundCombined)
    // Art types: .bankLogo, .schemeLogo, .cardBackground, .cardBackgroundCombined, .coBrandLogo, .cardIcon.

    // card metadata retrieval
    let cardMetadata = try await digitalCard.cardMetadata
    let panLastDigits = cardMetadata.panLastDigits
    let panExpiry = cardMetadata.panExpiry

    // card payment key information
    let paymentKeyInfo = try await digitalCard.paymentKeyInfo
    let numberOfPaymentsLeft = paymentKeyInfo.numberOfPaymentsLeft
    let needsReplenishment = paymentKeyInfo.needsReplenishment

    // card details
    let cardDetail = try await digitalCard.details
    let scheme = cardDetail.scheme
    let supportedPaymentTypes = cardDetail.paymentTypesSupported

  } catch {
    // Handle errors.
  }
}
```

{% endcode %}

### Get auxiliary card details

If the card is co-badged, you can retrieve additional properties from `digitalCard`.

* `DigitalCard.hasAuxiliaryScheme`: Returns `true` if the card has an auxiliary scheme

If the card is co-badged, you can also read:

* `DigitalCard.Details.auxiliaryScheme`: Auxiliary payment scheme
* `DigitalCard.CardMetadata.auxiliaryTokenLastDigits`: Last four digits of the auxiliary token
* `DigitalCard.CardMetadata.auxiliaryTokenExpiry`: Auxiliary token expiry date
* `DigitalCard.paymentKeyInfo.auxiliaryNumberOfPaymentsLeft`: Remaining payments for the auxiliary scheme

If the card is not co-badged, these properties return `nil`.

{% code title="Get auxiliary scheme details" %}

```swift
// Co-badged card additional details
let details = try await digitalCard.details
let cardMetadata = try await digitalCard.cardMetadata
let paymentKeyInfo = try await digitalCard.paymentKeyInfo

if digitalCard.hasAuxiliaryScheme {
  let auxScheme = details.auxiliaryScheme

  let auxTokenLastDigits = cardMetadata.auxiliaryTokenLastDigits
  let auxTokenExpiry = cardMetadata.auxiliaryTokenExpiry

  let auxNumPaymentsLeft = paymentKeyInfo.auxiliaryNumberOfPaymentsLeft

  // These values are `nil` if the card is not co-badged.
}
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.payments.thalescloud.io/nfc-wallet-sdk-ios/implement-nfc-wallet/manage-digital-cards/display-digital-cards.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
