---
title: "iOS SDK: Custom URL handler"
description: "Handle widget links with a custom URL handler with the Gleap iOS SDK. Follow the integration code examples."
url: https://docs.gleap.ai/en/articles/454-ios-sdk-custom-url-handler
collection: "iOS"
updated: 2026-11-01
language: en
---

# iOS SDK: Custom URL handler

Handle widget links with a custom URL handler with the Gleap iOS SDK. Follow the integration code examples.

In certain applications, having granular control over how hyperlinks are managed is crucial. This document outlines how to override the default URL handling behavior in your iOS app using the Gleap framework. By configuring a custom URL handler, you delegate the responsibility of opening URLs from the Gleap framework to a handler of your choosing. This allows for tailored handling of URL interactions based on the specific needs of your application.

## Configure the URL handler

Use our `GleapDelegate` protocol. This protocol includes the method that handles URL loading:

```swift
import Foundation
import UIKit
import Gleap

// Add the GleapDelegate protocol to your view controller
class DemoViewController: UIViewController, GleapDelegate {

    override func viewDidLoad() {
        // Assign self to the delegate
        Gleap.sharedInstance().delegate = self;
    }

    func openExternalLink(_ url: URL) {
        // Handle url
    }
}
```

## Related

- [iOS SDK setup](https://docs.gleap.ai/en/articles/434-ios-sdk-setup.md)
- [iOS SDK: User identity](https://docs.gleap.ai/en/articles/435-ios-sdk-user-identity.md)
- [iOS SDK: Callbacks](https://docs.gleap.ai/en/articles/436-ios-sdk-callbacks.md)
- [iOS SDK: Frontend tools](https://docs.gleap.ai/en/articles/437-ios-sdk-frontend-tools.md)
- [iOS SDK: Forms](https://docs.gleap.ai/en/articles/438-ios-sdk-forms.md)
