Docs
grovs.io Start for free

Link creation

Generate smart links from your Unity game with the Grovs SDK.

Create smart links from the game with GenerateLinkAsync, then share them.

C#
using System.Collections.Generic;
using GrovsSDK;
using UnityEngine;
 
async void ShareInvite()
{
    try
    {
        string link = await Grovs.GenerateLinkAsync(new GenerateLinkOptions
        {
            Title = "Join my team",
            Subtitle = "Level 3 is waiting",
            ImageUrl = "https://example.com/share.png",
            Data = new Dictionary<string, object> { { "level", 3 }, { "inviter", "player-42" } },
            Tags = new List<string> { "invite" },
            TrackingCampaign = "spring",
            TrackingSource = "in_game",
            TrackingMedium = "share_button"
        });
        GUIUtility.systemCopyBuffer = link;
    }
    catch (GrovsException e)
    {
        Debug.LogWarning("Link failed: " + e.Error);
    }
}

The callback version passes the error instead of throwing:

C#
Grovs.GenerateLink(options, (link, error) =>
{
    if (error != null) Debug.LogWarning(error);
    else Debug.Log(link);
});

Both complete on the Unity main thread. A null options object creates a link with no metadata.

Options

Every field of GenerateLinkOptions is optional. A null field is left out of the request.

FieldTypeDescription
TitlestringLink preview title
SubtitlestringLink preview subtitle
ImageUrlstringLink preview image URL
DataIDictionary<string, object>Custom payload delivered in DeeplinkReceived
TagsIList<string>Tags for filtering and analytics
IosRedirectGrovsRedirectWhere the link sends iOS visitors
AndroidRedirectGrovsRedirectWhere the link sends Android visitors
DesktopRedirectGrovsRedirectWhere the link sends desktop visitors
ShowPreviewIosbool?Show the link preview on iOS. null uses the dashboard default.
ShowPreviewAndroidbool?Show the link preview on Android. null uses the dashboard default.
CopyToClipboardIosbool?Copy the link to the visitor's clipboard on the iOS preview page, for clipboard-assisted deferred deep linking. null uses the project setting.
CopyToClipboardAndroidbool?Same, for the Android preview page.
TrackingCampaignstringUTM campaign
TrackingSourcestringUTM source
TrackingMediumstringUTM medium

Data values must be JSON-serializable: strings, numbers, booleans, null, lists and string-keyed dictionaries of these. Anything else throws ArgumentException before the request is sent.

Custom redirects

GrovsRedirect overrides where a link sends visitors on one platform:

C#
var options = new GenerateLinkOptions
{
    Title = "Spring event",
    AndroidRedirect = new GrovsRedirect { Url = "https://example.com/android", OpenAppIfInstalled = true },
    DesktopRedirect = new GrovsRedirect { Url = "https://example.com/event", OpenAppIfInstalled = false }
};
FieldTypeDefaultDescription
UrlstringnoneThe redirect URL. A redirect without a URL is ignored.
OpenAppIfInstalledbooltrueOpen the game instead when it's installed.

Errors

The task fails with a GrovsException whose Error.Code is:

CodeWhen
LinkGenerationFailedThe backend didn't return a link.
SdkDisabledGrovs is disabled. See Privacy & Consent.
SdkNotInitializedThe native SDK didn't start, for example because the API key is empty.
UnsupportedPlatformRunning in the Editor or on a platform other than iOS and Android.
UnknownAndroid: another native failure. Error.Message has the details.

While authentication is still retrying, iOS waits until it succeeds and then generates the link. Android fails right away.

See also

Last updated 2026-10-26
Was this page helpful?