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

# Handle deeplinks

> Forward incoming URLs to the SDK so it can resume a transaction after returning from an external app or page.

When a transaction redirects the user to an external destination. Another app, a wallet, a bank flow, or a hosted page. The user eventually returns to your app or site. The iOS and Android SDKs expose `handleDeeplink` so you can forward that incoming URL and let the SDK resume the transaction.

The Web SDK has no `handleDeeplink`. When the shopper comes back to your return URL, the page loads fresh and the SDK keeps no state across the redirect. Read the checkout session you stored, or the one in your return URL, and call `sdkPayments.transactionStatus({ checkoutSession, elementSelector })`. The SDK renders the payment outcome for that session into `elementSelector`. Pass `language` and `countryCode` to match the original transaction. The screen is display-only, so confirm the result through webhooks or the payments API.

## Behavior

`handleDeeplink(url)` accepts any URL. Decide when to call it based on the URL itself. For example, when it carries query parameters like `customer` or `checkoutSession` that identify it as belonging to a Yuno transaction.

The method returns a boolean indicating whether the transaction could be continued. It does not reflect the final result of the transaction. The final status still arrives through `onStatus`.

On iOS the same call also receives the return URL of a Revolut Pay payment when the [Revolut Pay module](/docs/yuno-sdk/features/native-modules#revolut-pay) is installed.

## Where to call it

Call `handleDeeplink` from wherever your app receives an incoming URL.

<Tabs>
  <Tab title="iOS">
    Use `AppDelegate` if you use UIKit, or the SwiftUI lifecycle if your app is SwiftUI-based.

    **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>

  <Tab title="Android">
    `handleDeeplink` is a method of `Transaction`. Forward the URI from the Activity that receives the deeplink intent, passing that Activity as the first argument — the SDK starts the resumed flow's screens from it: cover both the cold start (`onCreate`) and the warm return (`onNewIntent`). A session carried in the URL takes precedence over the one in `TransactionConfig`; the config session is the fallback when the URL only carries a 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>
</Tabs>

## Signature

```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
```

## Related

* [Transactions](/docs/basic-concepts/transactions). How a payment flows through Yuno.
* [`onStatus`](/docs/yuno-sdk/controllers/on-status). Receives the final status of the transaction.


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