I'm integrating AppsFlyer into my Unity project to handle deep linking via OneLink. My goal is to capture deep link data when my app is opened through a link. I've set up everything according to the AppsFlyer documentation (https://dev.appsflyer.com/hc/docs/unifieddeeplink#:~:text=The%20SDK%20triggers%20the%20OnDeepLink,the%20main%20goal%20of%20OneLink.) , including the initialization of the SDK, registering the deep link event handler, and starting the SDK. However, when I test by opening my app with a deep link, only the conversion data callback (onConversionDataSuccess) is triggered, and the onDeepLink callback doesn't seem to be executed.

Here's the relevant part of my script attached to a GameObject named AppsFlyerObject:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using AppsFlyerSDK;
using System;

namespace Example
{
    public class ExamplerAppsFlyerObjectScript : MonoBehaviour
    {
        void Start()
        {
            Debug.Log("AppsFlyerObjectScript Start");
            AppsFlyer.initSDK("devKey", "AppId", this);
            AppsFlyer.OnDeepLinkReceived += onDeepLink;
            AppsFlyer.startSDK();
        }

        void onDeepLink(object sender, EventArgs args)
        {
            Debug.Log("OnDeepLink Start");

            if (!(args is DeepLinkEventsArgs deepLinkEventArgs)) return;

            string campaign = deepLinkEventArgs.getCampaign();
            string mediaSource = deepLinkEventArgs.getMediaSource();
            Debug.Log($"Campaign: {campaign}, Media Source: {mediaSource}");

            Debug.Log($"DeepLink Status: {deepLinkEventArgs.status.ToString()}");

            switch (deepLinkEventArgs.status)
            {
                case DeepLinkStatus.FOUND:

                    if (deepLinkEventArgs.isDeferred())
                    {
                        Debug.Log("OnDeepLink: This is a deferred deep link");
                    }
                    else
                    {
                        Debug.Log("OnDeepLink: This is a direct deep link");
                    }

                    var deepLinkParamsDictionary = GetDeepLinkParamsDictionary(deepLinkEventArgs);
                    if (deepLinkParamsDictionary != null)
                    {
                        ParseDeepLinkParams(deepLinkParamsDictionary);
                    }
                    break;

                case DeepLinkStatus.NOT_FOUND:
                    Debug.Log("OnDeepLink: Deep link not found");
                    _deepLinkParamsDictionary = new Dictionary<string, object> { ["deep_link_not_found"] = true };
                    break;

                default:
                    Debug.Log("OnDeepLink: Deep link error");
                    _deepLinkParamsDictionary = new Dictionary<string, object> { ["deep_link_error"] = true };
                    break;
            }
        }

        // Other methods omitted for brevity
    }
}

And here is my AndroidManifest.xml setup for deep linking:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="AppID">
    <application>
        <activity android:name="com.unity3d.player.UnityPlayerActivity">
            <intent-filter>
                <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="OneLinkWhichWorks" />
            </intent-filter>
        </activity>
    </application>
</manifest>

When testing the deep link, I can confirm the app opens, and onConversionDataSuccess logs the conversion data correctly, indicating the SDK is initialized and working. However, the onDeepLink method doesn't log any deep link data, and it seems like it's not being called at all.

What I've checked so far:

The AppsFlyer SDK is correctly initialized with my dev key and app ID.
The deep link event handler is registered before calling AppsFlyer.startSDK().
The AndroidManifest.xml is configured for deep linking.

I'm testing on an Android device. My Unity version is 2020.3 LTS, and I'm using the latest version of the AppsFlyer Unity SDK.

Has anyone encountered a similar issue or can spot what I might be doing wrong? Any insights or suggestions would be greatly appreciated

What I've checked so far:

The AppsFlyer SDK is correctly initialized with my dev key and app ID.
The deep link event handler is registered before calling AppsFlyer.startSDK().
The AndroidManifest.xml is configured for deep linking.

I'm testing on an Android device. My Unity version is 2020.3 LTS, and I'm using the latest version of the AppsFlyer Unity SDK.

Expecting: My deep link function to handle when the link is used to open the app

Source: View source