Unity OneLink (AppsFlyer Deep Links)
When a player taps an AppsFlyer OneLink, the SDK resolves it through AppsFlyer and raises a C# event with the link's data, so you can open the right screen, apply a promo code, credit a referral, and so on. It covers both a direct deep link (the game is installed and the link opens it) and a deferred one (the player installs the game from the link, and the data arrives on the first launch).
Requires com.alogame.sdk 1.0.0 or later, and AppsFlyer as the game's attribution provider (attribution_provider: "appsflyer", set by your operator). With Adjust, or with no provider, the event is never raised.
The SDK only delivers the link data. Deciding where it leads inside the game is your game's job.
1. OneLink template (operator)
Your operator creates the OneLink template in the AppsFlyer dashboard and gives you its domain (for example yourgame.onelink.me). The template needs:
- Android: the package name and the SHA-256 fingerprint of every certificate that signs a build you install: the Play App Signing certificate for Play builds, plus your own keystore for test builds. See Android OneLink.
- iOS: the Apple Team ID and the bundle ID.
2. Register the domain
Android. Enable Player Settings → Publishing Settings → Custom Main Manifest, then add this inside <application> in Assets/Plugins/Android/AndroidManifest.xml, with your template's domain as the host:
<activity
android:name="vn.oeg.sdk.v2.core.analytics.OneLinkEntryActivity"
android:exported="true">
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="yourgame.onelink.me" />
</intent-filter>
</activity>
Keep android:name exactly as shown: it refers to an Activity inside the SDK, which passes the link to AppsFlyer and brings the game forward. Leave UnityPlayerActivity as it is.
iOS. Add the Associated Domains capability with applinks:yourgame.onelink.me, either in the generated Xcode project (Signing & Capabilities → + Capability → Associated Domains) or in your entitlements file.
There is nothing to forward from code. AlogameSDK.Initialize already passes every link Unity receives (Application.deepLinkActivated, and Application.absoluteURL at launch) to the SDK.
3. Receive the link data
Subscribe once, early, for example right after AlogameSDK.Initialize:
using Alogame.SDK;
AlogameSDK.Initialize(53); // your game id
AlogameAnalytics.DeepLinkResolved += data =>
{
if (!data.TryGetValue("deep_link_value", out var target) || target is not string value) return;
var isDeferred = data.TryGetValue("is_deferred", out var d) && d is bool b && b;
// Route the player, e.g. value = "shop", "event_halloween", "invite"
};
- The event is raised on the main thread.
- A deferred deep link usually resolves at startup, often before you subscribe. The SDK holds the most recent link and delivers it once to the first subscriber, during the
+=. - Do not also register
OEGAnalytics.setAttributionListener(Android) orOEGAnalytics.shared.attributionDelegate(iOS) in native code. The Unity package owns the SDK's single listener, and a native one would replace it. - For a link your game receives some other way, call
AlogameAnalytics.ProcessDeeplink(url).
data is AppsFlyer's raw click-event payload; see Link data for the keys. Every key is optional and may be null; is_deferred is a bool.
Testing
Test on a device; the Editor has no native bridge, so the event is never raised there.
- Ask your operator for a OneLink with a
deep_link_valueyou handle. - Android only: after installing, run
adb shell pm get-app-links your.package.name. The OneLink domain must showverified; otherwise the template's package name or SHA-256 does not match this build. - Direct: with the game installed, open the link from a messaging or notes app (not by typing it into the browser's address bar). The event should fire with
is_deferred = false. - Deferred: uninstall the game, open the link, install the build, and launch it. The event should fire once with
is_deferred = true.