Skip to content

Unity SDK

Install via Unity Package Manager from the Flinku Git repository.

Version: 0.1.2 · github.com/flinku-dev/unity-sdk

Installation (UPM)

In Unity: Window → Package Manager → + → Add package from git URL

text
https://github.com/flinku-dev/unity-sdk.git#0.1.2

Setup

Use your publishable key (flk_pk_) in apps. Never embed your secret key (flk_live_).

csharp
FlinkuSDK.Initialize(new FlinkuConfig {
    BaseUrl = "https://yourapp.flku.dev",
    ApiKey = "flk_pk_..." // optional — required for CreateLink / CreateLinkInstant
});

Match() with callback

csharp
FlinkuSDK.Instance.Match((result) => {
    if (result != null && !string.IsNullOrEmpty(result.DeepLink)) {
        // Open scene or deep link URI
    }
});

Requires Allowed Domains configured in project settings.

csharp
FlinkuSDK.Instance.CreateLink(new FlinkuLinkOptions {
    Title = "Summer Campaign",
    DeepLink = "yourapp://promo",
}, (link, error) => {
    if (error != null) Debug.LogError(error);
    else Debug.Log(link.ShortUrl);
});

C# example

csharp
using UnityEngine;

public class FlinkuBootstrap : MonoBehaviour
{
    void Start()
    {
        FlinkuSDK.Initialize(new FlinkuConfig {
            BaseUrl = "https://yourapp.flku.dev",
            ApiKey = "flk_pk_..."
        });

        FlinkuSDK.Instance.Match((m) =>
        {
            if (m != null)
                Debug.Log($"Deferred: {m.DeepLink}");
        });
    }

    public void OnSharePressed()
    {
        FlinkuSDK.Instance.CreateLink(
            new FlinkuLinkOptions
            {
                Title = "Invite",
                DeepLink = "mygame://lobby",
            },
            (link, err) =>
            {
                if (err != null) { Debug.LogError(err); return; }
                Debug.Log(link.ShortUrl);
            });
    }
}

The modern Firebase Dynamic Links replacement.