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 Link Flow at a Glance
Understanding Deep Link Anatomy
Deep links contain three main parts that you'll use for routing:
Example 1: mygame://invite/player123
Scheme:
mygame- Identifies your appHost:
invite- Identifies the actionPath:
/player123- Contains action parameters
Example 2: https://yourgame.com/level/5?mode=hard
Scheme:
https- Universal link schemeHost:
yourgame.com- Your domainPath:
/level/5- Content to displayQuery:
?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:
OnCustomSchemeUrlOpen
When user opens a custom scheme URL (e.g., mygame://)
OnUniversalLinkOpen
When user opens a universal link (e.g., https://yourgame.com/)
Register events early in your app initialization (like in a persistent manager's OnEnable) to ensure no deep links are missed.
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.
How Deep Links Work
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.
Basic Implementation
Handle both event types with the same logic:
Result Properties
Url
Uri
Parsed URL with easy access to components (Scheme, Host, Path, Query)
RawUrlString
string
Original URL string as received from the system
Parsing Deep Link Parameters
Use C#'s Uri class to extract deep link data:
Path Segments
Query Parameters
Always validate deep link parameters before using them. Users can manually create deep links with invalid data.
Common Navigation Patterns
Friend Invitations
Tournament Entry
Content Sharing
Add a lightweight helper to reuse the parsing logic:
Core APIs Reference
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
Only use custom delegates for advanced scenarios like ignoring deep links during tutorials or onboarding. For normal deep link handling, use the events directly.
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:
Advanced delegate filtering is for specific scenarios only. For most games, use standard event handling without custom delegates.
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
Related Guides
Demo scene:
Assets/Plugins/VoxelBusters/EssentialKit/Examples/Scenes/DeepLinkServicesDemo.unityPair 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
Ready to test? Head to the Testing Guide to validate your implementation.
Last updated
Was this helpful?