Usage

Deep Link Services allows handling custom URL schemes and universal links on mobile devices.

Essential Kit wraps native iOS and Android deep link APIs into a single Unity interface. When users click deep links, Essential Kit automatically routes them to your app and fires events with the link data.

Table of Contents

Deep links contain three main parts that you'll use for routing:

Example 1: mygame://invite/player123

  • Scheme: mygame - Identifies your app

  • Host: invite - Identifies the action

  • Path: /player123 - Contains action parameters

Example 2: https://yourgame.com/level/5?mode=hard

  • Scheme: https - Universal link scheme

  • Host: yourgame.com - Your domain

  • Path: /level/5 - Content to display

  • Query: ?mode=hard - Additional parameters

You'll use these components to determine what content to show when a deep link opens your app.

Import Namespaces

Event Registration

Register for deep link events in OnEnable and unregister in OnDisable:

Event
Trigger

OnCustomSchemeUrlOpen

When user opens a custom scheme URL (e.g., mygame://)

OnUniversalLinkOpen

When user opens a universal link (e.g., https://yourgame.com/)

Check Availability

Guard your handlers in case the feature is disabled on the current platform:

The call returns false in editor play mode if you excluded Deep Link Services from the build configuration.

Essential Kit handles deep links intelligently based on your app state:

App Already Running: Events fire immediately when the deep link is activated.

App Launched by Deep Link: Essential Kit delays the event until you register the event handler. This ensures your app is fully initialized before processing the link.

You don't need to check if the app was launched by a deep link. Just register events when ready, and Essential Kit fires them automatically if a deep link is pending.

Basic Implementation

Handle both event types with the same logic:

Result Properties

Property
Type
Description

Url

Uri

Parsed URL with easy access to components (Scheme, Host, Path, Query)

RawUrlString

string

Original URL string as received from the system

Use C#'s Uri class to extract deep link data:

Path Segments

Query Parameters

Common Navigation Patterns

Friend Invitations

Tournament Entry

Content Sharing

Add a lightweight helper to reuse the parsing logic:

Core APIs Reference

API
Purpose
Returns

DeepLinkServices.OnCustomSchemeUrlOpen

Event fired when custom scheme URL opens app

DeepLinkServicesDynamicLinkOpenResult via callback

DeepLinkServices.OnUniversalLinkOpen

Event fired when universal link opens app

DeepLinkServicesDynamicLinkOpenResult via callback

DeepLinkServices.IsAvailable()

Check if deep link services are available

bool

DeepLinkServices.Delegate

Advanced: Set custom delegate for filtering links

IDeepLinkServicesDelegate

Advanced: Custom Delegate Filtering

Understanding Custom Delegates

Default Behavior: Essential Kit processes all deep links matching your configuration and fires events automatically.

Advanced Usage: Use a custom delegate to filter which deep links your app should handle:

  • Ignore deep links during tutorial or onboarding

  • Filter links based on user authentication status

  • Prevent deep links in specific game states

Implementation

Create a delegate class:

Set the delegate before registering events:

Manual Initialization (Advanced)

Essential Kit auto-initializes Deep Link Services. Only use manual initialization for runtime configuration:

Use Cases for Manual Initialization:

  • Dynamically registering URL schemes from server configuration

  • Setting up deep links for white-label apps with different schemes

  • Loading deep link configurations from remote JSON at runtime

For standard usage, skip manual initialization. Essential Kit handles setup automatically based on your Settings configuration.

  • Demo scene: Assets/Plugins/VoxelBusters/EssentialKit/Examples/Scenes/DeepLinkServicesDemo.unity

  • Pair with Notification Services to send push notifications with deep links

  • Use with Sharing Services to let players share deep links to social media

  • Combine with Game Services for social feature deep linking

Last updated

Was this helpful?