Unreal Engine SDK: Implementing Deep Links

Introduction

Deep links are links that lead into specific content inside an app. When a user clicks a deep link on a device that has the app installed, the app opens and shows a specific product or experience.

Singular tracking links can include deep linking as well as deferred deep linking (see our Deep Linking FAQ and the Singular Links FAQ for more information).

The instructions below will show you how to:

  1. Access the tracking link that led to your app being opened,
  2. Read the deep link destination, and
  3. Show the appropriate content.

Notes:

  • This article assumes your organization is using Singular Links - Singular's new tracking link technology, launched in 2019. Older customers of Singular may be using Singular's older tracking links (legacy links). To support deep linking with legacy links, see Handling Deep Links with Legacy Links.
  • The deep link destinations for your app need to be set up on the Apps page in Singular (see Configuring Deep Link URLs).

Deep Linking Prerequisites

iOS and Android Setup

Follow the instructions in Singular Links Prerequisites to enable deep linking.

Handling Deep Links

The Singular SDK provides a handler mechanism to read the details of the tracking link that led to the app being opened.

To use the handler:

  1. Implement the OnSingularLinkResolved interface.
  2. Register to OnSingularLinkResolved delegate before initializing the Singular SDK to register the class as the handler for deep links.
  3. When you Initialize the Singular SDK, it fetches the tracking link and calls the OnSingularLinkResolved method, passing the tracking link details to it. Override this method to read the link details and process them.

The following sample code shows the three steps:


  // Add to the include section of your app
  #include "SingularLinkParams.h"
  #include "SingularDelegates.h"
  
  // Add this method to your class
  void YourClass::SingularLinksResolved(const FSingularLinkParams& linkParams) { 
const FString deeplink = linkParams.SingularLinksParams["deeplink"]; const FString passthrough = linkParams.SingularLinksParams["passthrough"]; const bool isDeferred = linkParams.SingularLinksParams["isDeferred"]; } ... // Call this code before calling initialize USingularDelegates* singularDelegates = CreateDefaultSubobject<USingularDelegates>(TEXT("SingularLinksHandler")); singularDelegates->OnSingularLinksResolved.AddDynamic(this, &YourClass::SingularLinksResolved); ...
SingularLinksResolved Method Details
Description Callback method for Singular Links. Read the tracking link details and process them.
Signature
public void OnSingularLinksResolved(const FSingularLinkParams& linkParams)

Note: The FSingularLinkParams object contains the following values:

  • Deeplink - The deep link destination, as configured in the Manage Links page in the Singular platform.
  • Passthrough - Passthrough parameters added to the link, if any.
  • IsDeferred - Is the link configured as a deferred deep link.