Search Unity

Add deep links to your Unity mobile apps for better user experience

, 7월 16, 2020

Adding deep links within your Unity project is a simple way to drive users directly to specific content in a mobile app – no navigation required. That content becomes easily shareable and more interactive, bringing new users, guiding existing users to new content, and more.

A deep link in a mobile app is a URL that brings a user directly to a specific in-app location. For example, deep links in a music app allow friends to share their favorite playlists, which automatically open in the music app. Embedded in search results, a deep link can take users directly to rich content in a particular app, rather than sending them to a website where they might have to enter search details again.

In addition to taking users directly to the content they’re looking for, deep links give developers the ability to add logic to the link. For example, you can drive engagement in your game by letting users share rewards or gifts via a deep link URL in SMS (or another messaging system) or allow users to jump from one game to specific content in another game, creating seamless user experiences between them. This increases user engagement and reduces friction in your mobile apps.

We introduced deep link support in Unity 2019.2 and it’s available for Android, iOS, and Universal Windows Platform (UWP). This blog post explains how you can get up and running with deep links in your Unity app.

Setting up deep links

In essence, deep linking allows you to launch, and pass parameters to, your application via a single link. You can then direct users to a specific area in your application from various sources like a web page or an SMS text message. 

To start, Unity calls the Application.deepLinkActivated event when an application is activated from a deep link URL. To process deep links in this scenario, you can:

For example, you can attach the code below to a “deep link manager” GameObject in your startup Scene.

Configuring for different platforms

Configuring an app to react to specific URLs is platform-specific: 

  • iOS: You configure the URL scheme from the Player Settings window in the Supported URL schemes section. 
  • Android: You set up an intent filter that overrides the standard app manifest to include a specific intent-filter section for Activity.
  • Universal Windows Platform (UWP): You configure a custom URI scheme from the Player Settings window in the Protocol section.

For more information about platform-specific setups, see the Enabling deep linking documentation page.

Testing your deep links

The easiest way to test a deep link is to create a simple HTML page, host it on a local web server, and access it from a web browser on your device. For example:

Check out our sample project 

We have created a sample project to demonstrate how you can implement deep linking to start your app from somewhere other than the main menu. You can find the project source here. The end result looks like this:

7 replies on “Add deep links to your Unity mobile apps for better user experience”

can we install app in case if its not installed using deep link? and then reach to the point where we want to take our user?

There is also a plugin in the asset store (developer here) that does all the configuration and setup automatically, so no need to do any manifest changes or query string parsing.

The plugin is called Universal Deep Linking and besides supporting Android, iOS and UWP it also supports standalone Windows, Mac, Linux, and tvOS, out of the box without any conflicts with other plugins.

Does this work to get the deep-link after app install if the app was not installed before ?

Thanks for showing some examples of this.
Is there a particular reason why this hasn’t been implemented for Windows Desktop? Seems a lot of apps use deep linking there nowadays (Discord, Slack, Visual Studio Code, … just to name a few).

Standalone builds (besides macOS) are a bit tougher to implement out of the box because desktop apps usually don’t allow activation to apps that are already running (deep links come on the main function arguments), so to give support to this some proxy (usually a second instance of the same app) is required to check and send data to the first launched application.

Comments are closed.