SDK / UNITY

Deep linking for Unity apps.

Resolve a URL delivered to your Unity app through the SDK coroutine API, then route with its destination or JSON payload.

Package

com.wilderbots.wilderlinks

1.0.0 · Unity 2021.3+

01 / Install

Add the SDK

UPM Git URLtext
https://github.com/hellowilderlinks-cmyk/wilderlinks-sdks.git?path=/unity

02 / Configure

Initialize once

Use the WilderLinks API base URL and add the exact link host configured for your app. Replace links.example.com with that host.

WilderlinksBootstrap.cscsharp
using Wilderbots.Wilderlinks;

public static class WilderlinksBootstrap
{
    public static void Configure()
    {
        WilderlinksClient.Init(new WilderlinksConfig(
            baseUrl: "https://api.wilderlinks.space",
            domains: new[] { "links.example.com" }
        ));
    }
}

04 / Deferred matching

Match only tokens your app can access

DeferredInstall.cscsharp
using UnityEngine;
using Wilderbots.Wilderlinks;

public sealed class DeferredInstallCheck : MonoBehaviour
{
    public void CheckClipboardFallback()
    {
        StartCoroutine(WilderlinksClient.CheckDeferredInstall(result =>
        {
            if (result.matched)
            {
                Debug.Log(result.deepLinkPayloadJson);
            }
        }));
    }
}

  • CheckDeferredInstall(...) reads a clipboard fallback token.
  • Unity C# does not include a Play Install Referrer bridge. For Android production installs, add an app-side native bridge, read dl_match_token, then call MatchDeferredToken(baseUrl, token, callback).
  • MatchInstallAttributionToken(...) exchanges a token supplied by your own attribution flow; it does not acquire an iOS App Store token.

05 / Platform setup

Before testing on a device

  • Add the package in Unity Package Manager using the UPM Git URL shown above. The package identifier is com.wilderbots.wilderlinks.
  • The client resolves only URLs delivered to your app. Configure iOS Universal Links and Android App Links in the native app and associate the hosts with your app.
  • Pass the configured smart-link host in WilderlinksConfig.domains. The sample host is a placeholder; replace it with your workspace domain.

06 / Security

Keep private credentials server-side

Do not ship organization or private API keys in mobile apps, browser JavaScript, or Unity client builds. Client-side link resolution and authenticated link-management operations have different trust boundaries; keep API-key operations in a trusted server environment.

To create a link in response to an action in your Unity app, send the link details to an endpoint in your own backend using your app’s normal user authentication. That backend must verify the user is allowed to create the link, then call WilderLinks (for example, POST /api/v1/links) with the organization API key held only on the server.

  1. Your app sends the requested destination and link settings to your backend.
  2. Your backend authenticates and authorizes the user, then creates the WilderLinks link.
  3. Your backend returns the generated URL; the app shares or displays it using its platform-appropriate UI.

The Unity SDK’s link-creation and event methods require the organization API key. Do not configure that secret in a publicly distributed game build.

These SDKs do not provide your app’s authenticated link-creation backend endpoint; implement that endpoint in your own backend.

07 / Troubleshooting

When a link does not match

  • Init(...) must run before HandleIncomingUrl(...); the client requires its static config.
  • Check that the URL host is listed in domains and that native app-link association delivers the URL to Unity.
  • The callback receives a result with matched and error; deepLinkPayloadJson is a JSON string, not a parsed C# object.

Continue building