Skip to main content

Deep Linking & Push Navigation

When a user taps a push notification, the DashX SDK resolves a NavigationAction from the payload and either handles it automatically or hands it to your app. This page covers how navigation is resolved, the available hooks, and how to wire up deep links and universal / app links.

Every notification tap (including action-button taps) resolves to one of four navigation types:

ActionWhenBehaviour
Screenscreen_name is presentIn-app navigation to a named screen with optional screen_data
Rich Landingurl is present and rich_landing is trueOpens the URL in an in-app browser (SFSafariViewController / Custom Tabs)
Deep Linkurl is presentOpens the URL externally (system browser, another app, or your app via universal / app links)
Click Actionclick_action is presentLaunches an Activity class or intent action (Android) or maps to a UNNotificationCategory (iOS)

Resolution priority: Screen > Rich Landing > Deep Link > Click Action. The first match wins; remaining fields are ignored.

Payload fields

These fields can be set at the top level of a push notification or per action button when creating a broadcast (see Send Messages):

FieldTypeDescription
urlStringDeep link or rich-landing URL
screen_nameStringNamed in-app screen
screen_dataMap<String, String>Key-value parameters passed to the screen
rich_landingBooleanWhen true, opens url in an in-app browser instead of externally
click_actionStringActivity class / intent action (Android) or notification category (iOS)
action_buttonsArrayEach button carries its own identifier, label, plus the fields above

Handling notification taps

Subclass DashXAppDelegate

DashXAppDelegate wires push permission, delivery / click / dismiss tracking, and sets DashXClient.instance.linkHandler to your handleLink(url:) override.

Override onNotificationClicked and return true to handle navigation yourself. Return false (the default) to let the SDK apply its built-in behaviour.

import DashXFirebase

@main
class AppDelegate: DashXAppDelegate {

override func onNotificationClicked(
message: [AnyHashable: Any],
action: NavigationAction?,
actionIdentifier: String
) -> Bool {
switch action {
case .screen(let name, let data):
navigate(to: name, params: data)
return true // handled — SDK will not open a URL or call legacy hooks
default:
return false // let the SDK handle deep links, rich landing, etc.
}
}

override func handleLink(url: URL) {
// Called by the SDK for deep links (NavigationAction.deepLink)
// Route the URL to the appropriate screen
}
}

The deprecated notificationClicked(message:actionIdentifier:) hook is still called as a fallback for .screen and .clickAction when onNotificationClicked returns false.

Subclass DashXSceneDelegate

DashXSceneDelegate forwards custom URL schemes and universal links into the SDK automatically:

import DashX

class SceneDelegate: DashXSceneDelegate {
// scene(_:openURLContexts:) — custom URL schemes → processURL
// scene(_:continue:) — universal links → handleUserActivity

// Add your own scene logic and call super for the methods above.
}

If you are not using DashXSceneDelegate, call these yourself:

DashXClient.instance.processURL(url, source: "scene_url")
DashXClient.instance.handleUserActivity(userActivity: userActivity)

Rich landing customisation

Set DashXBrowser.safariConfiguration to customise the SFSafariViewController before it is presented:

DashXBrowser.safariConfiguration = { safari in
safari.preferredBarTintColor = .systemBackground
safari.dismissButtonStyle = .close
}

Host-app configuration

  • Universal Links — add the Associated Domains capability (applinks:yourdomain.com) and host an apple-app-site-association file on your domain. DashXSceneDelegate handles continuation automatically.
  • Custom URL Schemes — register the scheme in Info > URL Types. Ensure scene(_:openURLContexts:) calls through to DashXSceneDelegate (or call processURL yourself).

Analytics events

The SDK automatically tracks two events for deep linking:

EventFired when
dx_deep_link_openedA URL is opened (notification tap, universal link, custom URL scheme, or manual processDeepLink / processURL call)
dx_notification_navigatedAny notification tap — includes the resolved navigation type (deep_link, screen, rich_landing, click_action, or default) and destination data