---
updatedAt: 2026-09-30T09:31:03.000Z
agentTools:
  projectIndex: https://docs.reteno.com/llms.txt
---

# iOS Links Handler

During a Mobile Push creation in the Reteno account you can specify the Link field in the form. It might be either some web page url, or deep link to the application.

<Image align="center" width="80% " src="https://files.readme.io/5a14d09-adding_links.png" alt="Mobile Push editor with Carousel of images selected and a Link URL entered, showing the iOS notification preview" />

By default Reteno SDK will open it via system method `UIApplication.shared.open(url, options: [:], completionHandler: nil)`

From Reteno SDK 1.5.5 onwards, you can add your own link handler:

```swift
Reteno.addLinkHandler { [weak self] url in
    guard
        let components = URLComponents(url: url, resolvingAgainstBaseURL: true),
        components.host == "example-app.esclick.me",
        let linkItem = UniversalLinkItem(rawValue: components.path)
    else {
        // if it's not a deep link, just open Safari
        UIApplication.shared.open(url)
        return
    }
    
    self?.applicationFlowCoordinator.handleUniversalLink(linkItem)
}
```

From Reteno SDK 1.7.2 onwards link handler has a new value in closure is `customData`. You can pass it from inApp `OPEN_URL` data sys action type.

```swift
Reteno.addLinkHandler { [weak self] url, customData in
    guard
        let components = URLComponents(url: url, resolvingAgainstBaseURL: true),
        components.host == "example-app.esclick.me",
        let linkItem = UniversalLinkItem(rawValue: components.path)
    else {
        // if it's not a deep link, just open Safari
        UIApplication.shared.open(url)
        return
    }

    self?.applicationFlowCoordinator.handleUniversalLink(linkItem)
}
```

Starting from Reteno SDK 2.0.2 onwards link handler has a single value in the closure `LinkHandler`. You can receive `url`, `customData`, and `source` - indicating from where the link handler was triggered.

Links from In-App message buttons arrive in the same handler: `linkInfo.url` holds the button's link, and `linkInfo.source` shows where the tap came from.

```swift
Reteno.addLinkHandler { [weak self] linkInfo in
    guard
        let components = URLComponents(url: linkInfo.url, resolvingAgainstBaseURL: true),
        components.host == "example-app.esclick.me",
        let linkItem = UniversalLinkItem(rawValue: components.path)
    else {
        // if it's not a deep link, just open Safari
        UIApplication.shared.open(url)
        return
    }

    // linkInfo.customData
    // linkInfo.source

    self?.applicationFlowCoordinator.handleUniversalLink(linkItem)
}
```

<Callout icon="📘" theme="info">
  ### Note

  The link handler is called when the user taps a notification that contains a link. If a mobile push has no link, the link handler is not called — read the notification's custom data directly from the push payload in your app.
</Callout>

Using Universal links you have to provide your own link handler, since there is no way the link open in your app. For more information about Universal Links visit [Apple documentation](https://developer.apple.com/documentation/xcode/allowing-apps-and-websites-to-link-to-your-content).

When the user taps a notification with a link, the SDK sends a HEAD request to that link to register the click, also when your link handler processes the link. If link tracking is off, the request goes to the link itself, and if that address requires authorization, the request can fail, for example with 401. This doesn't affect how the link opens in your app.