AppsFlyerSDK / appsflyer-unity-plugin

AppsFlyer Unity Plugin
MIT License
156 stars 64 forks source link

The OnDeepLinkReceived event is not called in Unity (UDL) #198

Closed TheZipa closed 1 year ago

TheZipa commented 1 year ago

OnDeepLinkReceived event is not called in Unity

I'm trying to get Deep Link status (Found or Not Found) according to the documentation for UDL. For some reason the event is not being called, however Conversion Data comes in consistently. The subscription happens after AppsFlyer.initSDK() as described in the documentation. I attach AppsFlyerObjectScript.cs with the subscription to OnDeepLinkReceived.

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

// This class is intended to be used the the AppsFlyerObject.prefab

public class AppsFlyerObjectScript : MonoBehaviour, IAppsFlyerConversionData
{

    // These fields are set from the editor so do not modify!
    //******************************//
    public string devKey;
    public string appID;
    public string UWPAppID;
    public string macOSAppID;
    public bool isDebug;
    public bool getConversionData;
    //******************************//

    void Start()
    {
        // These fields are set from the editor so do not modify!
        //******************************//
        AppsFlyer.setIsDebug(isDebug);
#if UNITY_WSA_10_0 && !UNITY_EDITOR
        AppsFlyer.initSDK(devKey, UWPAppID, getConversionData ? this : null);
#elif UNITY_STANDALONE_OSX && !UNITY_EDITOR
    AppsFlyer.initSDK(devKey, macOSAppID, getConversionData ? this : null);
#else
        AppsFlyer.initSDK(devKey, appID, getConversionData ? this : null);
#endif
        AppsFlyer.OnDeepLinkReceived += OnDeepLink;
        //******************************/
        AppsFlyer.startSDK();
    }

    private void OnDeepLink(object sender, EventArgs e)
    {
        Debug.Log("On Deep Link Received");
    }

    // Mark AppsFlyer CallBacks
    public void onConversionDataSuccess(string conversionData)
    {
        AppsFlyer.AFLog("didReceiveConversionData", conversionData);
        Dictionary<string, object> conversionDataDictionary = AppsFlyer.CallbackStringToDictionary(conversionData);
        // add deferred deeplink logic here
    }

    public void onConversionDataFail(string error)
    {
        AppsFlyer.AFLog("didReceiveConversionDataWithError", error);
    }

    public void onAppOpenAttribution(string attributionData)
    {
        AppsFlyer.AFLog("onAppOpenAttribution", attributionData);
        Dictionary<string, object> attributionDataDictionary = AppsFlyer.CallbackStringToDictionary(attributionData);
        // add direct deeplink logic here
    }

    public void onAppOpenAttributionFailure(string error)
    {
        AppsFlyer.AFLog("onAppOpenAttributionFailure", error);
    }
}

Xcode says only the following:

AppsFlyerTest[3650:167052] AppsFlyer Debug: handle deep link SendMessage: object AppsFlyerObjectScript does not have receiver for function onDeepLinking

Build for iOS platform. AppsFlyer versions are 6.6.1 and 6.5.4 (tried both)

af-do commented 1 year ago

Hi @TheZipa,

Thank you for reaching out! Please open a ticket to our support@appsflyer.com with the previous info, code snippet of the AppsFlyer Integration, and some logs if possible. They will be able to further help you!

Thank you!

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 14 days since being marked as stale.