> 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/classic-push-provisioning/es/casos-de-uso/ver-y-controlar/ver-obtener-lista-de-tokens.md).

# Ver: obtener lista de tokens

Con el SDK de Push Provisioning, la aplicación del emisor puede recuperar la lista de tokens para una tarjeta específica y las ubicaciones donde se solicitaron esos tokens. El usuario final puede entonces navegar por la lista de tokens y ver:

* El estado del token (habilitado o deshabilitado).
* Identificador del solicitante de tokens.
* Información del dispositivo, como ID del dispositivo, nombre y tipo (cuando lo proporciona el TSP).
* Fecha de caducidad del token.
* Los últimos cuatro dígitos del token.
* Si el token está en el dispositivo actual (`isOnCurrentDevice`) cuando la aplicación del emisor está configurada para Google Pay, Samsung Pay o Apple Pay.

La figura siguiente muestra un ejemplo de la experiencia de usuario que la aplicación del emisor puede implementar:

<figure><img src="/files/4bae9a742dfe2ba2b5915c501c9f85c59f6cce9f" alt=""><figcaption><p>Ejemplo de experiencia de usuario de la lista de tokens.</p></figcaption></figure>

El SDK de Push Provisioning requiere la información de la tarjeta (PAN y fecha de caducidad) para recuperar la lista de tokens. La figura siguiente muestra una descripción general del flujo que la aplicación del emisor debe implementar:

<figure><img src="/files/83acc3a43a9b606023aab010ee277059e71b6623" alt=""><figcaption><p>Flujo para obtener la lista de tokens.</p></figcaption></figure>

\
**Nota**

* Debido a limitaciones de la red de pagos, no puedes recuperar en tiempo real el nombre y el logotipo del solicitante de tokens.
* Recomendamos que la aplicación del emisor identifique los 5–10 principales identificadores de solicitantes de tokens y codifique de forma fija un nombre y logotipo orientados al comerciante o la cartera.

### Integración del SDK <a href="#sdk-integration" id="sdk-integration"></a>

#### Paso 1: Obtención de los datos cifrados de la tarjeta <a href="#step-1-getting-the-encrypted-card-details" id="step-1-getting-the-encrypted-card-details"></a>

Para recuperar la lista de tokens, la aplicación del emisor debe proporcionar los datos cifrados de la tarjeta al SDK de Push Provisioning.

El backend del emisor proporciona los datos cifrados de la tarjeta a la aplicación del emisor. Los datos de la tarjeta usan el [formato PKCS#7](/classic-push-provisioning/es/guia-del-desarrollador/cifrado-y-autenticacion-de-datos/cifrado-de-datos-de-la-tarjeta-formato-pkcs-7.md).

#### Paso 2: Obtención de la lista de tokens <a href="#step-2-getting-the-token-list" id="step-2-getting-the-token-list"></a>

Después de que la aplicación del emisor recupere los datos cifrados de la tarjeta desde el backend del emisor, puede solicitar la lista de tokens.

El siguiente fragmento de código muestra un ejemplo de cómo recuperar la lista de tokens mediante el SDK de Push Provisioning:

{% tabs %}
{% tab title="Swift" %}

```swift
func getTokens() {
    let scheme = CardScheme.Mastercard
    let payload = "PKCS7 encrypted PAN"
    
    let card = FundingCard(scheme: scheme,
                           encryptedPayload: payload)
    
    TPCSDK.getTokens(card: card) {
      (tokenList, error) in
      if let tokenList = tokenList {
          for token in tokenList {
              if(token.isOnCurrentDevice){
                  // Este token está en el dispositivo actual.
              }
          }
      }
    }
  }
```

{% endtab %}

{% tab title="Objective-C" %}

```objective-c
- (void) getTokens {
  CardScheme scheme = CardSchemeMastercard;
  NSString * payload = @"PKCS7 encrypted PAN";
  
  FundingCard * card = [[FundingCard alloc] initWithScheme:scheme
                                          encryptedPayload:payload];
  
  [TPCSDK getTokensWithCard:card
                 completion:^(NSArray<Token *> * _Nullable tokenList, NSError * _Nullable error) {
  }];
}
```

{% endtab %}

{% tab title="Android" %}

```java
CardInfo cardInfo = new CardInfo();
cardInfo.setScheme("VISA");
cardInfo.setEncryptedPayload("PAYLOAD")
cardInfo.setAuthorizationCode("AUTHORIZATION_CODE");
cardInfo.setLast4PanDigits("1234");
cardInfo.setIssuerAppId("ISSUERID");

final TPCSDKListener<Token[]> tokenListener = new TPCSDKListener<Token[]>() {
    @Override
    public void onStart() {
        // al iniciar
    }

    @Override
    public void onSuccess(TPCResult<Token[]> result) {
	      Log.i("TAG", "get tokenLsit request success");
        Token[] tokens = result.getResult();
        if (tokens != null) {
          for (int i = 0; i < tokens.length; i++) {
            if (tokens[i].isOnCurrentDevice()) {
              // Este token está en el dispositivo actual.
            }
          }
        }
    }

    @Override
    public void onError(TPCSDKException exception) {
        // Error al obtener la lista de tokens
        Log.i("TAG", "get tokenList request failed");
    }
};

TPCManager.getInstance().getTSHProxy().getTokenList(cardInfo, tpcsdkListener);
```

{% endtab %}
{% endtabs %}


---

# 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:

```
GET https://docs.payments.thalescloud.io/classic-push-provisioning/es/casos-de-uso/ver-y-controlar/ver-obtener-lista-de-tokens.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
