iOS SDK
Deep links
Open the right screen when a push or a card is tapped, with Xulo.onOpen.
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.
Handle the link
Set Xulo.onOpen early, next to Xulo.start. Return true when your app opened the link.
Xulo.onOpen = { url, data in
guard let url, url.scheme == "exampleapp" else {
return false
}
Router.shared.open(url, data: data)
return true
}
urlis the push link, ornilwhen the push has none.datais the push's data dictionary, with your values as text. It also holdsdraft_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.
Where the link comes from
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.