iOS (Swift)

Check out some examples of how to set up deeplinks and listen for webview redirects in iOS 🍏.


In order to be able to use the hosted widget in your iOS app, make sure that you:

Set up deeplinks in your iOS application

In your Info.plist file, add the following code:

      <string>[YOUR IDENTIFIER]</string> <!-- Your app name -->
         <string>belvowidget</string> <!-- The Belvo deeplink you need to add. -->

Handle events in your webview

In the code sample below you can see an example of how to listen and handle for events within your webview.

public func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Swift.Void) {
        if(navigationAction.navigationType == .other) {
            if navigationAction.request.url != nil {
                if == "success" {
                    var url = navigationAction.request.url
                    var link = self.getParameterFrom(url: url, param: "link")
                    var institution = self.getParameterFrom(url: url, param: "institution")
                  // Do something with the link and institution.
                else if == "error" {
                    // If the redirect starts with "error",
                    // Do something with the error.
                else {
                  // If the redirect starts with "exit",
                  // Do something with the exit information.

Did this page help you?