> ## Documentation Index
> Fetch the complete documentation index at: https://docs.y.uno/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# Manejar deeplinks

> Reenvía las URL entrantes al SDK para que pueda reanudar una transacción después de volver desde una app o página externa.

Cuando una transacción redirige al usuario a un destino externo: otra app, una billetera, un flujo bancario o una página alojada. El usuario eventualmente vuelve a tu app o sitio. Los SDK de iOS, Android y React Native exponen `handleDeeplink` para que puedas reenviar esa URL entrante y dejar que el SDK reanude la transacción.

El SDK de Web no tiene `handleDeeplink`. Cuando el comprador vuelve a tu URL de retorno, la página se carga de nuevo y el SDK no conserva ningún estado a través de la redirección. Lee la sesión de checkout que guardaste, o la que viene en tu URL de retorno, y llama a `sdkPayments.transactionStatus({ checkoutSession, elementSelector })`. El SDK muestra el resultado del pago de esa sesión dentro de `elementSelector`. Pasa `language` y `countryCode` para que coincidan con la transacción original. La pantalla es solo de visualización, así que confirma el resultado mediante webhooks o la API de pagos.

## Comportamiento

`handleDeeplink(url)` acepta cualquier URL. Decide cuándo llamarlo según la propia URL. Por ejemplo, cuando incluye parámetros de consulta como `customer` o `checkoutSession` que la identifican como parte de una transacción de Yuno.

El método devuelve un booleano que indica si la transacción pudo continuar. No refleja el resultado final de la transacción. El estado final sigue llegando mediante `onStatus`.

En iOS, la misma llamada también recibe la URL de retorno de un pago con Revolut Pay cuando el [módulo de Revolut Pay](https://docs.y.uno/es/docs/yuno-sdk/features/native-modules.md#revolut-pay) está instalado.

## Dónde llamarlo

Llama a `handleDeeplink` desde donde tu app reciba una URL entrante.

> [tab] iOS
>
> Usa `AppDelegate` si usas UIKit, o el ciclo de vida de SwiftUI si tu app está basada en SwiftUI.
>
> **UIKit (`AppDelegate`)**
>
> ```swift theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
> func application(
>     _ app: UIApplication,
>     open url: URL,
>     options: [UIApplication.OpenURLOptionsKey : Any] = [:]
> ) -> Bool {
>     if SdkPayments.handleDeeplink(url) {
>         return true
>     }
>     // Handle other URLs here.
>     return false
> }
> ```
>
> **SwiftUI (`onOpenURL`)**
>
> ```swift theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
> @main
> struct MyApp: App {
>     var body: some Scene {
>         WindowGroup {
>             ContentView()
>                 .onOpenURL { url in
>                     SdkPayments.handleDeeplink(url)
>                 }
>         }
>     }
> }
> ```

> [tab] Android
>
> `handleDeeplink` es un método de `Transaction`. Reenvía el URI desde la Activity que recibe el intent del deeplink, pasando esa Activity como primer argumento: el SDK inicia las pantallas del flujo reanudado desde ella. Cubre tanto el inicio en frío (`onCreate`) como el regreso en caliente (`onNewIntent`). Una sesión incluida en la URL tiene prioridad sobre la de `TransactionConfig`; la sesión de la configuración es la alternativa cuando la URL solo incluye un token.
>
> ```kotlin theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
> class MainActivity : ComponentActivity() {
>
>     override fun onCreate(savedInstanceState: Bundle?) {
>         super.onCreate(savedInstanceState)
>         intent?.data?.let(::forwardDeeplink)
>     }
>
>     override fun onNewIntent(intent: Intent) {
>         super.onNewIntent(intent)
>         intent.data?.let(::forwardDeeplink)
>     }
>
>     private fun forwardDeeplink(uri: Uri) {
>         val handled = Transaction(
>             TransactionConfig(
>                 countryCode = "US",
>                 checkoutSession = "session-from-backend",
>                 controller = controller,
>             ),
>         ).handleDeeplink(this, uri)
>         if (!handled) {
>             // Handle other URLs here.
>         }
>     }
> }
> ```

> [tab] React Native
>
> Conecta el esquema de URL de tu app con `Linking` de React Native (en iOS, reenvía la URL desde tu `AppDelegate` como describe la documentación de React Native), y luego entrega cada URL a la transacción que iniciaste. En un inicio en frío, pasa la URL de `Linking.getInitialURL()` de la misma manera.
>
> ```tsx theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
> useEffect(() => {
>   const subscription = Linking.addEventListener('url', ({ url }) => {
>     transaction.handleDeeplink(url).then((handled) => {
>       if (!handled) {
>         // Handle other URLs here.
>       }
>     });
>   });
>   return () => subscription.remove();
> }, [transaction]);
> ```
>
> `SdkPayments.handleDeeplink(url)` hace lo mismo sin una referencia a la transacción: usa la última transacción iniciada.

## Firma

```swift theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
// iOS
@discardableResult
func handleDeeplink(_ url: URL) -> Bool
```

```kotlin theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
// Android: method of Transaction
fun handleDeeplink(activity: ComponentActivity, uri: Uri): Boolean
```

```typescript theme={"theme":{"light":"github-dark","dark":"github-dark-dimmed"}}
// React Native
transaction.handleDeeplink(url: string): Promise<boolean>
SdkPayments.handleDeeplink(url: string): Promise<boolean>
```

## Relacionado

* [Transacciones](https://docs.y.uno/es/docs/basic-concepts/transactions.md). Cómo fluye un pago a través de Yuno.
* [`onStatus`](https://docs.y.uno/es/docs/yuno-sdk/controllers/on-status). Recibe el estado final de la transacción.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.