You can create deep links to take users to specific pages in your app. The Adjust SDK uses different logic depending on if the user already has your app installed on their device:
- Direct deep linking: occurs if the user already has your app installed. The link takes the user to the page specified in the link
- Deferred deep linking: occurs if the user doesn’t have your app installed. The link takes the user to a storefront to install your app first. After the user installs the app, it opens to the page specified in the link.
The SDK can read deep link data after a user opens your app from a link.
Set up deep linking
If a user has your app installed, it opens when they interact with a link containing deep link information. The Adjust SDK contains tools to parse deep link information for use throughout your app. To configure deep linking in your app, you need to choose a unique scheme name and assign it to a specified handler method. To do this:
- Open the Solution Explorer.
- Double click
Package.appxmanifest
to open the manifest designer. - Select the Declarations tab.
- Select Available Declarations —> Protocol and select Add.
- Choose a name for your URI scheme. The URI scheme name must be lowercase.
- Press Ctrl+S to save your changes.
Next, you need to set up your OnActivated
event handler. This handles the activated deep link event. To set this up, add the following to your your App.xaml.cs
file:
Your app opens when a user interacts with a link containing your unique scheme name in the deep_link
parameter. This value must be URL-encoded in the URL. The Adjust SDK delivers the result as unencoded text.
Deferred deep linking
You can configure the Adjust SDK to call a delegate function when it receives a deferred deep link. This delegate function receives the deep link as a string
argument. Once the SDK receives the deep link content from Adjust’s servers, it delivers it through this delegate function and expects a bool
return value. This value represents whether the SDK should launch the OnActivated
event handler.
Reattribution using deep links
To reattribute a user, you need to make an extra call to the Adjust SDK within your app. Add a call to the appWillOpenUrl(Uri, Context)
method when the app receives deep link content. The Adjust SDK will then look for new attribution data within the deep link. If the SDK finds new information, it will forward it to Adjust’s servers for reattribution.
If the user needs to be reattributed due to clicking on an Adjust deep link, this triggers the attribution callback.
You must call Adjust.AppWillOpenUrl
in the OnActivated
method of your app: