통합된 딥링킹(UDL)

UDL 흐름

  1. SDK는 다음에 의해 트리거됩니다.
    • 디퍼드 딥링킹 - 전용 API 사용
    • 직접 딥링킹 - 안드로이드 앱 링크, iOS 유니버설 링크 또는 URI 스키마를 통해 OS로 트리거됩니다.
  2. The SDK triggers the OnDeepLink 메서드, 그리고 딥링크 결과 개체를 사용자에게 전달합니다.
  3. The OnDeepLink 메서드는 및 기타 파라미터가 포함된 딥링크 결과 개체 deep_link_value 를 사용하여 원링크의 주요 목표인 사용자를 위한 개인화된 경험을 생성합니다.

안드로이드iOS용 통합 딥링킹 문서를 확인하십시오.

고려 사항 

  • 앱스플라이어 안드로이드 SDK V6.1.3 이상이 필요합니다.
  • SRN 캠페인을 지원하지 않습니다.
  • For new users, the UDL method only returns parameters relevant to deferred deep linking: deep_link_value and deep_link_sub1-10. 다른 파라미터 (media_source, campaign, af_sub1-5 등)를 얻으려고 하면 다음을 반환합니다. null.
  • onAppOpenAttribution 호출되지 않습니다. 모든 코드는 다음으로 마이그레이션해야 합니다. OnDeepLink.
  • OnDeepLink 이후에 호출해야 합니다. initSDK.
  • AppsFlyer.cs 게임 오브젝트에 첨부되어야 합니다.

구현하기

  1. 첨부 AppsFlyer.cs 스크립트를 앱스플라이어 초기화 코드로 게임 개체에 첨부합니다. (AppsFlyerObject)
  2. 할당 OnDeepLink to AppsFlyer.OnDeepLinkReceived 값을 Start()
     AppsFlyer.OnDeepLinkReceived += OnDeepLink;
    
  3. 이후 initSDK() 구현 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;
      }
  }
}