Deep Links
Deep links enable your application to open specific screens or content directly from notifications, web pages, or external sources. By integrating deep links, you can guide users to precise destinations within your app — enhancing engagement and creating seamless navigation between notifications, campaigns, and in-app experiences.
In this guide, we synthesized the necessary steps to enable deep linking in your application, but you can take a look at the official .NET MAUI deep linking guides for Android and iOS form more information on the subject.
Overview
Handling deep links in your Android application allows you to:
- Support Deep Link notification types from Actito.
- Handle custom URL schemes or HTTPS links from web pages.
Once configured, your app can interpret incoming URLs and display the appropriate screen or content dynamically.
Declaring a custom URL scheme
- Android
- iOS
To enable your app to handle a custom URL scheme, declare an activity and its corresponding intent filter in your MainActivity.cs Be sure to update the scheme attribute to match your own application’s scheme.
[Activity(...)]
[IntentFilter(
[Intent.ActionView],
Categories = [Intent.CategoryDefault, Intent.CategoryBrowsable],
DataScheme = "com.example")]
public class MainActivity : MauiAppCompatActivity {
}
To enable your app to handle a custom URL scheme, declare your custom URL scheme in your Info.plist. Be sure to update the scheme to match yours.
With this configuration, links such as com.example://example.com/product?id=1 will automatically open your application.
Handling Deep Link
- Android
- iOS
When a user opens a deep link — either from a notification or a web page — your application will be executed and the Actito.onUrlOpened event will be called:
public class MainActivity : MauiAppCompatActivity
{
protected override void OnCreate(Bundle? savedInstanceState)
{
base.OnCreate(savedInstanceState);
// more code ...
if (Intent != null) HandleIntent(Intent);
}
protected override void OnNewIntent(Intent? intent)
{
base.OnNewIntent(intent);
// more code ...
if (intent != null) HandleIntent(intent);
}
private void HandleIntent(Intent intent)
{
// more code ...
if (Actito.HandleDynamicLinkIntent(this, intent))
{
Console.WriteLine("Dynamic link handled.");
return;
}
var uri = intent.Data;
if (uri != null)
{
// Open a view based on the received URI.
}
}
}
This implementation ensures that standard deep links are properly handled.
When a user opens a deep link — either from a notification or a web page — your app will handle the link.
public class AppDelegate : MauiUIApplicationDelegate
{
// more code ...
public override bool OpenUrl(UIApplication application, NSUrl url, NSDictionary options)
{
if (Actito.HandleDynamicLinkUrl(url))
{
return true;
}
// Handle deep link
return false;
}
public override bool ContinueUserActivity(UIApplication application, NSUserActivity userActivity, UIApplicationRestorationHandler completionHandler)
{
var handled = base.ContinueUserActivity(application, userActivity, completionHandler);
if (handled) return true;
var url = userActivity.WebPageUrl;
if (url == null) return false;
return false;
}
}
This implementation ensures that both standard deep links and Actito dynamic links are properly handled.
Supporting external deep links (Android 11+)
If your app needs to open external deep links (for example, to open URLs in the browser), Android 11 and higher requires you to declare supported schemes explicitly in your manifest:
<queries>
<intent>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>
</queries>
This allows your application to safely query and launch external URLs.
Handling notification links
Deep links are also used within HTML and Web Page notification types. To handle links clicked inside these notifications, declare the supported URL schemes in your manifest and define them in a resource file.
This functionality is available only when notifications are presented using the Actito.PushUI module. If you handle notification presentation manually, you are responsible for processing clicked URLs within your own implementation.
- Android
- iOS
Add Metadata in the Manifest
<meta-data
android:name="com.actito.push.ui.notification_url_schemes"
android:resource="@array/notification_url_schemes" />
Define the Schemes
Create a resource file named notification_url_schemes.xml in Platforms/Android/Resources/values/ and add the supported URL schemes to it.
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="notification_url_schemes">
<item>com.example</item>
<item>com.example2</item>
<item>com.example3</item>
</string-array>
</resources>
Add URL schemes in the ActitoOptions.plist
<plist version="1.0">
<dict>
<key>URL_SCHEMES</key>
<array>
<string>com.example</string>
<string>com.example2</string>
<string>com.example3</string>
</array>
</dict>
</plist>
This configuration allows the SDK to intercept links matching any of the defined schemes and trigger a callback when clicked.
Any click in an HTML or Web Page notification type, would be intercepted by our library and trigger the event ActitoPushUI.onNotificationUrlClicked.
ActitoPushUI.NotificationUrlClicked += (sender, args) =>
{
Console.WriteLine($"About to present notification: {args.Url}");
};