Xulo Docs

iOS SDK

Deep links

Open the right screen when a push or a card is tapped, with Xulo.onOpen.

iOS SDK 0.1.4 View as Markdown

A push can carry a link and a data dictionary. When the person taps it, the SDK calls Xulo.onOpen with both, and your app decides which screen to open.

Set Xulo.onOpen early, next to Xulo.start. Return true when your app opened the link.

Swift
Xulo.onOpen = { url, data in
    guard let url, url.scheme == "exampleapp" else {
        return false
    }
    Router.shared.open(url, data: data)
    return true
}
  • url is the push link, or nil when the push has none.
  • data is the push's data dictionary, with your values as text. It also holds draft_id, the numeric id of the send.

What the SDK does

Your handler returns Link Result
true any Nothing more. Your app handled it.
false, or no handler https://… The link opens in the system browser.
false, or no handler any other scheme Nothing more.

The SDK does not open a web view. If you want a page inside the app, open it yourself in your handler and return true.

The dashboard, an agent and the REST API all write the same two fields: the link and the data. From the REST API they are url (or app_url) and data. See Send notification.

In the payload they are custom.u and custom.a. See Notifications.

In-app cards

A card's button link goes through the same Xulo.onOpen handler, with the same rules.