Skip to main content

Deep Links (iOS)

This guide is split into focused, ordered modules. Each one does a single job, so you can follow them top to bottom — or jump straight to the part you need.

New to Paylisher deep linking? Read the platform-neutral Deep Linking — Overview first. It explains the link types, the four-layer mental model, pathSegments, and attribution — the concepts every module below builds on.

This track targets Paylisher iOS 1.8.4 or later (iOS 13+). For Android, see the Android track.


What you'll build

Paylisher receives an incoming link, resolves its campaign data, stamps attribution onto your analytics events, and hands you a parsed object so you can navigate the user to the right screen. You write only two things: one line to forward the link, and a small router.

Link typeExampleWhen it fires
Custom schemeyourapp://products/42App installed; opened from another app, web, or a notification.
Universal Linkhttps://link.paylisher.com/c/AbC123App installed; opened from Safari/email/social — no "Open in app?" prompt.
Deferred deep link(resolved on first launch)App was not installed when tapped; destination delivered after install.

The modules

Follow these in order. Modules 2–5 are the core integration; the rest you add when you need them.

#ModuleWhat you do
2PrerequisitesDeclare your custom scheme in Info.plist and add Associated Domains for Universal Links.
3SDK setupSet deepLinkConfig, call setup(), and register your handlers.
4Forwarding linksHand OS links to the SDK — SwiftUI one-liner, UIKit, or SceneDelegate (iOS 13).
5Routing ⭐Turn the parsed link into navigation — pick the tab, push the nested screen.
6Auth-gated destinationsGate screens behind login (e.g. wallet).
7Deferred deep linksRecover the destination on the first launch after install.
8Attribution & sourceCampaign keys, jid, and the canonical campaign_source — all automatic.
9Creating linksBuild dashboard links whose target path matches your routes.
10TestingFire links with xcrun simctl openurl and verify the right screen opens.
11ReferenceAPI, the PaylisherDeepLink object, troubleshooting, and a checklist.

The shortest possible integration

If you just want to see a link work, here is the whole core in one place. Each piece is explained in its module.

import Paylisher

// Module 3 — configure & set up
let config = PaylisherConfig(apiKey: "phc_YOUR_PROJECT_KEY", host: "https://us.i.paylisher.com")
let deepLinkConfig = PaylisherDeepLinkConfig()
deepLinkConfig.customSchemes = ["yourapp"]
deepLinkConfig.universalLinkDomains = ["link.paylisher.com"]
config.deepLinkConfig = deepLinkConfig
PaylisherSDK.shared.setup(config)

// Module 5 — route the parsed link to a screen
PaylisherSDK.shared.onDeepLink { deepLink, requiresAuth in
guard !requiresAuth else { return }
DeepLinkRouter.shared.navigate(deepLink)
}
// Module 4 — forward OS links (SwiftUI: one modifier on your root view)
ContentView().paylisherDeepLinks()

Start with Prerequisites