# Unity deep linking for games

> How Unity receives deep links with Application.absoluteURL and Application.deepLinkActivated, how to configure Android intent filters and iOS associated domains for a Unity build, and how the Strait Unity library adds deferred deep links for invites and rewards.

Source: https://straitlink.in/guides/unity-deep-linking/
Markdown: https://straitlink.in/guides/unity-deep-linking.md

- [Guides](https://straitlink.in/guides/)
- Unity

# 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.

- Guide
- Android
- iPhone
- `strait-sdk-unity`
- [Faster: one prompt](https://straitlink.in/ai/#prompt-unity)

STEPS · 4

- [1How Unity sees a link](https://straitlink.in/guides/unity-deep-linking/#how-unity-sees-a-link)
- [2Android build settings](https://straitlink.in/guides/unity-deep-linking/#android-build-settings)
- [3iOS build settings](https://straitlink.in/guides/unity-deep-linking/#ios-build-settings)
- [4Designing links for a game](https://straitlink.in/guides/unity-deep-linking/#designing-links-for-a-game)

**Step 1 of 4**How Unity sees a link

AT A GLANCE · UNITY

- Builds on : `strait-sdk-unity`

- Platforms : Android, iPhone

- Start in the docs : [Unity SDK](https://straitlink.in/docs/sdks/unity/)

- Free plan : 25,000 taps a month, no card

## How 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](https://straitlink.in/docs/sdks/unity/) adds: `Client.Start(Application.absoluteURL)` for the launch link and the once-per-install deferred check, and `Client.HandleUrl(url)` for later links.

Check on a device before you ship

The C# library is tested in CI. The Unity glue (MonoBehaviour, PlayerPrefs, the iOS plugin, UnityWebRequest) hasn't been run in the Unity editor or on a device yet.

## 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](https://straitlink.in/docs/sdks/android/#4-add-the-intent-filters) 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:

```
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.

## Designing links for a game

- **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](https://straitlink.in/docs/sdks/unity/)

Docs for this setup

## Where to go next for Unity

- [Unity SDK The C# library, storage, device fields and events](https://straitlink.in/docs/sdks/unity/)
- [Deferred deep links How a link survives the install](https://straitlink.in/docs/deferred-deep-linking/)
- [App Links & Universal Links The verification behind a direct open](https://straitlink.in/docs/app-links/)

Check your setup

## Free tools for the parts that usually break

- [Will it open my app? Simulate a tap from WhatsApp, Instagram or Chrome](https://straitlink.in/tools/will-it-open/)
- [assetlinks.json checker Is your Android App Links file right?](https://straitlink.in/tools/assetlinks-checker/)
- [AASA validator Is your apple-app-site-association file right?](https://straitlink.in/tools/aasa-validator/)
- [Troubleshooting When a link opens the browser instead of the app](https://straitlink.in/docs/troubleshooting/)

Other guides: [Expo](https://straitlink.in/guides/expo-deep-linking/) · [Next.js](https://straitlink.in/guides/nextjs-deep-linking/) · [FlutterFlow](https://straitlink.in/guides/flutterflow-deep-linking/) · [Capacitor and Ionic](https://straitlink.in/guides/capacitor-deep-linking/) · [Jetpack Compose (Kotlin)](https://straitlink.in/guides/jetpack-compose-deep-linking/) · [SwiftUI](https://straitlink.in/guides/swiftui-deep-linking/)

## Ship links that open your Unity app.

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

[Start free](https://app.straitlink.in/?signup=1) [Read the quick start](https://straitlink.in/docs/quick-start/)
