Deep Links for the Apple SDK

Configure deep link handling for Airship messaging.

Deep linking allows Airship messaging to open your app to specific resources or screens. When a user interacts with a message (notification, in-app message, etc.), the deep link can navigate them directly to the relevant content in your app.

The SDK provides a way to listen for deep links so you can handle them in your app. This handler receives all deep links except for Message Center and Preference Center display requests, which are handled automatically by their respective features.

 Note

For Message Center and Preference Center display requests, see Embedding the Message Center and Embedding the Preference Center.

Listening for deep links

Set the deep link listener after takeOff:

// Set deep link callback
Airship.onDeepLink = { url in
    // Handle deep link asynchronously
    await someNavigationTask(url)
}

Conform to UADeepLinkDelegate and set the delegate after takeOff:

@interface AppDelegate() <UADeepLinkDelegate>
@end

@implementation AppDelegate

// ... in didFinishLaunchingWithOptions, after takeOff ...
UAirship.deepLinkDelegate = self;

- (void)receivedDeepLink:(NSURL *_Nonnull)deepLink
       completionHandler:(void (^_Nonnull)(void))completionHandler {
    // Handle deep link
    completionHandler();
}

@end