통합된 딥링킹(UDL)

UDL flow

  1. The SDK is triggered by:
    • Deferred Deep Linking - using a dedicated API
    • Direct Deep Linking - triggered by the OS via Android App Link, iOS Universal Links or URI scheme.
  2. The SDK triggers the OnDeepLink 메서드, 그리고 딥링크 결과 개체를 사용자에게 전달합니다.
  3. The OnDeepLink 메서드는 및 기타 파라미터가 포함된 딥링크 결과 개체 deep_link_value 를 사용하여 원링크의 주요 목표인 사용자를 위한 개인화된 경험을 생성합니다.

Check out the Unified Deep Linking docs for Android and iOS.

고려 사항 

  • Requires AppsFlyer Android SDK V6.1.3 or later.
  • SRN 캠페인을 지원하지 않습니다.
  • For new users, the UDL method only returns parameters relevant to deferred deep linking: deep_link_value and deep_link_sub1-10. If you try to get any other parameters (media_source, campaign, af_sub1-5, etc.), they return null.
  • onAppOpenAttribution will not be called. All code should migrate to OnDeepLink.
  • OnDeepLink must be called after initSDK.
  • AppsFlyer.cs must be attached to the game object.

구현하기

  1. Attach AppsFlyer.cs script to the game object with the AppsFlyer init code. (AppsFlyerObject)
  2. Assign OnDeepLink to AppsFlyer.OnDeepLinkReceived in Start()
     AppsFlyer.OnDeepLinkReceived += OnDeepLink;
    
  3. After initSDK() implement OnDeepLink.

using AppsFlyerSDK;

public class AppsFlyerObjectScript : MonoBehaviour
{
  void Start()
  {
    AppsFlyer.initSDK("devkey", "appID", this);
    AppsFlyer.OnDeepLinkReceived += OnDeepLink;
    AppsFlyer.startSDK();
  }
  
  void OnDeepLink(object sender, EventArgs args)
  {
      var deepLinkEventArgs = args as DeepLinkEventsArgs;

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

              if (deepLinkEventArgs.isDeferred())
              {
                  AppsFlyer.AFLog("OnDeepLink", "This is a deferred deep link");
              }
              else
              {
                  AppsFlyer.AFLog("OnDeepLink", "This is a direct deep link");
              }
              
              // deepLinkParamsDictionary contains all the deep link parameters as keys
              Dictionary<string, object> deepLinkParamsDictionary = null;
      #if UNITY_IOS && !UNITY_EDITOR
              if (deepLinkEventArgs.deepLink.ContainsKey("click_event") && deepLinkEventArgs.deepLink["click_event"] != null)
              {
                  deepLinkParamsDictionary = deepLinkEventArgs.deepLink["click_event"] as Dictionary<string, object>;
              }
      #elif UNITY_ANDROID && !UNITY_EDITOR
                  deepLinkParamsDictionary = deepLinkEventArgs.deepLink;
      #endif

              break;
          case DeepLinkStatus.NOT_FOUND:
              AppsFlyer.AFLog("OnDeepLink", "Deep link not found");
              break;
          default:
              AppsFlyer.AFLog("OnDeepLink", "Deep link error");
              break;
      }
  }
}