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.
Deep linking on iOS
Follow the deep linking guide for iOS, except for the following steps, which can be performed directly within the MAUI environment:
Custom URL schemes
To configure Custom URL Scheme, locate the info.plist file, that is usually located at Platforms/iOS/Info.plist
, which is an xml
format.
There, the mentioned Identifier in the custom url scheme iOs deep linking guide should be part of the info.plist file such as:
<key>CFBundleIdentifier</key><string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
The string
tag value can also be replaced directly for your app bundle identifier
Also, you should configure the custom url types to include a custom name and scheme, as it can be seen in the snippet:
<key>CFBundleURLTypes</key><array> <dict> <key>CFBundleURLName</key> <string>your.unique.nameForTheDeepLink</string> <key>CFBundleURLSchemes</key> <array> <string>adjust-example</string> </array> </dict></array>
To capture a scheme-based deep link that opens your app, make sure to implement the OpenUrl
method in your iOS platform’s AppDelegate.cs
file:
public override bool OpenUrl(UIApplication app, NSUrl url, NSDictionary options){ // "url" instance contains the scheme based deep link that has opened your app
return base.OpenUrl(app, url, options);}
Set up universal links in your app
To configure univresal links, locate the Entitlements.plist
file, that should be located at Platforms/iOS/Entitlements.plist
. If file is not present, create one.
You should add all the universal link domains that your app plans to handle like this:
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict> <key>com.apple.developer.associated-domains</key> <array> <string>applinks:example.adj.st</string> </array></dict></plist>
To capture a universal link that opens your app, make sure to implement the ContinueUserActivity
method in your iOS platform’s AppDelegate.cs
file:
public override bool ContinueUserActivity(UIApplication application, NSUserActivity userActivity, UIApplicationRestorationHandler completionHandler){ // "userActivity.WebPageUrl" instance contains the unviersal link that has opened your app
return base.ContinueUserActivity(application, userActivity, completionHandler);}
Deep linking on Android
Configure your scheme name
In your MAUI Android project, locate the MainActivity
class, which typically inherits from MauiAppCompatActivity
and is found at Platforms/Android/MainActivity.cs
.
You can use the IntentFilter
attribute to assign a custom scheme to your activity. Various configuration options are documented here.
The following example demonstrates how to configure the MainActivity
class to respond to the scheme name adjust-example
:
[IntentFilter( new string[] { Intent.ActionView }, Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable }, DataScheme = "adjust-example")]public class MainActivity : MauiAppCompatActivity{ // ...}
Your app will now be able to handle URI schemes. When a user clicks a link that includes a deep_link
parameter containing your scheme name, the MainActivity
will be triggered.
https://app.adjust.com/abc123?deep_link=adjust-example%3A%2F%2F
Configure Android App Links
Make sure to configure your scheme name even if you’re setting up Android App Links for deep linking.
For Android App Links, add an IntentFilter
attribute to specify which URLs your app can handle. Be sure to set the AutoVerify
property to true
within the IntentFilter
attribute.
[IntentFilter( new string[] { Intent.ActionView }, Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable }, DataScheme = "adjust-example")][IntentFilter( new string[] { Intent.ActionView }, Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable }, DataScheme = "https", DataHost = "adjust.go.link", AutoVerify = true,)]public class MainActivity : MauiAppCompatActivity{ // ...}
Your app will now be able to handle Android App Links. When a user clicks a link containing the adjust.go.link
domain, your app will open automatically.
https://adjust.go.link/login?adj_t=abc123
Deferred deep linking
The Adjust SDK opens deferred deep links by default. No additional setup is required. If you want to disable this behavior, you need to set up a deferred deep link callback.
Set up a deferred deep link delegate
public Func<string, bool>? DeferredDeeplinkDelegate { get; set; }
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.
If you want to open the deep link, return true
in your delegate function. If you don’t want to open it, return false
.
AdjustConfig adjustConfig = new AdjustConfig("{YourAppToken}", AdjustEnvironment.Sandbox);adjustConfig.DeferredDeeplinkDelegate = (string deeplink) =>{ return true; if you want to open deep link // return false if you don't want to open deep link};
Adjust.InitSdk(adjustConfig);
Example
This example shows how to log a deep link address when the user opens a deferred deep link.
AdjustConfig adjustConfig = new AdjustConfig("{YourAppToken}", AdjustEnvironment.Sandbox);adjustConfig.DeferredDeeplinkDelegate = (string deeplink) =>{ Debug.Log("Deep link URL: " + deeplink); return true;};
Adjust.InitSdk(adjustConfig);
Reattribution via deep links
public static void ProcessDeeplink(AdjustDeeplink deeplink);
Adjust enables you to run re-engagement campaigns using deep links. For more information, check out how to set up Deep links in Campaign Lab.
To reattribute your user, you need to instantiatee an AdjustDeeplink
object with the deep link URL and pass it to the Adjust.ProcessDeeplink
method. The Adjust SDK then looks for new attribution data within the deep link. If the SDK finds new information, it forwards the information to Adjust’s servers for reattribution.
AdjustDeeplink adjustDeeplink = new AdjustDeeplink("url");Adjust.ProcessDeeplink(adjustDeeplink);
Enable LinkMe
public bool? IsLinkMeEnabled { get; set; }
The Adjust SDK lets you copy deep link information from the device pasteboard. When combined with Adjust’s LinkMe solution, this feature enables deferred deep linking on devices running iOS 15 and above.
When a user clicks on a LinkMe URL they have the option to copy the link information to their system pasteboard. You can use the Adjust SDK to read the system pasteboard for deep link information. If deep link information is present, the SDK forwards the user to the correct page in your app.
To enable pasteboard checking in your app, assign a true
value to the IsLinkMeEnabled
property of your AdjustConfig
instance.
AdjustConfig adjustConfig = new AdjustConfig("{YourAppToken}", AdjustEnvironment.Sandbox);adjustConfig.IsLinkMeEnabled = true;
Adjust.InitSdk(adjustConfig);