Deep links for Unity games

Invite links that drop a friend into your lobby, reward links in a newsletter, a QR code at an event. This guide covers how Unity receives links on Android and iOS, and how the Strait C# library keeps them through an install.

Step 1 of 4How Unity sees a link

Unity exposes two things. Application.absoluteURL holds the URL that launched the game, and Application.deepLinkActivated fires when a link arrives while it's running. Both work on Android and iOS once the build declares which links belong to the game. What Unity can't do on its own is remember a link through a store install, or turn https://hilltop.strait.link/squad-7 into the lobby it stands for. That's what the Unity library adds: Client.Start(Application.absoluteURL) for the launch link and the once-per-install deferred check, and Client.HandleUrl(url) for later links.

Android build settings

Unity generates the manifest, so link settings go in a custom one: enable Custom Main Manifest in Player Settings → Publishing Settings and add two intent filters to the game's activity. One with android:autoVerify="true" for https and hilltop.strait.link, one for your custom scheme. The Android setup page has the XML. The Play Install Referrer library goes in your Gradle dependencies (a custom main Gradle template or EDM4U), since it's how an invite survives the install.

For verified links, add the SHA-256 of your upload key and of Google Play's app signing key in Dashboard → Settings.

iOS build settings

Add your scheme under Supported URL schemes in Player Settings. Associated Domains live in the generated Xcode project, so add them in a post-build script rather than by hand after each build:

Assets/Editor/AssociatedDomains.cs
using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode;

public static class AssociatedDomains
{
    [PostProcessBuild]
    public static void OnPostBuild(BuildTarget target, string path)
    {
        if (target != BuildTarget.iOS) return;
        var project = PBXProject.GetPBXProjectPath(path);
        var manager = new ProjectCapabilityManager(project, "Unity-iPhone.entitlements", "Unity-iPhone");
        manager.AddAssociatedDomains(new[] { "applinks:hilltop.strait.link" });
        manager.WriteToFile();
    }
}

On iPhone, Universal Links were tested on a real iPhone in October 2026; the match after an App Store install is opt-in.

  • Invites: put the room or squad in the destination path (/join/squad-7) and route it in OnLink. A friend who installs from the invite lands in the same squad after the first launch.
  • Rewards: give each reward link an expiry, and check on your server that a reward is claimed once. A link is a pointer, not a voucher.
  • Events: a QR code on a poster is a link like any other; the free QR tool makes one, and each poster can carry its own utm_campaign.
  • Loading: a link can take a few seconds to resolve on a slow network. Show a spinner from OnLinkStart so the player isn't left on a blank scene.

Purchases sent with TrackEvent carry the tap that brought the player in, so Analytics shows which invite or campaign led to spending.

Open the Unity docs

Ship links that open your Unity app.

Free for 25,000 taps a month, no card. Every tap gets a trace you can read.