iOS 拡張ディファードディープリンク



  • When UDL returns NOT_FOUND even though a relevant install occurred.
    Main example for such a scenario:
    • クリックからインストールまでの時間が UDLルックバック期間 (15 分) を超えた場合
  • When UDL returns FOUND but the deep linking data is missing parameters, which are not deep_link_value and deep_link_sub1-10.
    Main examples for such scenarios:
    • Meta adsやTwitterなどのSRN(Self Reporting Network)内のリンクをクリックした場合
    • Clicking a link that doesn't contain deep_link_value or deep_link_sub1-10 used for deep-linking, for example, old links created before deep_link_value existed that are still in use.
    • クリックからインストールまでの時間が UDLルックバック期間 (15 分) を超えた場合

To allow deferred deep linking when UDL returns NOT_FOUND, onConversionDataSuccess callback should check whether it should handle the deferred deep linking.
onConversionDataSuccess is part of the Get Conversion Data(GCD) API. Its main purpose was is to gather conversion data inside the device.
In the use case outlined here onConversionDataSuccess takes advantage of the fact that all deferred deep linking parameters are passed to the callback, on top of the conversion data.



  1. onConversionDataSuccess should detect cases where deferred deep linking should occur that UDL didn't handle.


  2. onConversionDataSuccess {0} は、UDLが処理しなかったディファードディープリンクが発生するケースを検出する必要があります。


Code dissect

  1. Implement the Get Conversion Data API delegate AppsFlyerLibDelegate.

    Implement only onConversionDataSuccess and onConversionDataFail.
    The methods onAppOpenAttribution and onAttributionFailure are mutually exclusive with UDL, and will not be called.

  2. コンバージョンデータのペイロードをフィルターすることで、ディファードディープリンクシナリオを検出します:
    • af_status == Non-organic
    • is_first_launch == true
  3. When deferred deep linking is detected, filter-out the cases that were already handled by UDL.
    In the example that follows, all the links contain deep_link_value.
    It is recommended for UDL to signal with a flag that deferred deep linking was already handled, and onConversionDataSuccess should skip.
  4. onConversionDataSuccess should verify the conversion data holds parameters that are used to route users inside the application. For example fruit_name in the example that follows.
  5. ユーザーをディファードディープリンク先にルーティングします。

Code snippet

extension AppDelegate: AppsFlyerLibDelegate {
    // Handle Organic/Non-organic installation
    func onConversionDataSuccess(_ data: [AnyHashable: Any]) {
        ConversionData = data
        print("onConversionDataSuccess data:")
        for (key, value) in data {
            print(key, ":", value)
        if let conversionData = data as NSDictionary? as! [String:Any]? {
            if let status = conversionData["af_status"] as? String {
                if (status == "Non-organic") {
                    if let sourceID = conversionData["media_source"],
                        let campaign = conversionData["campaign"] {
                        NSLog("[AFSDK] This is a Non-Organic install. Media source: \(sourceID)  Campaign: \(campaign)")
                } else {
                    NSLog("[AFSDK] This is an organic install.")
                if let is_first_launch = conversionData["is_first_launch"] as? Bool,
                    is_first_launch {
                    NSLog("[AFSDK] First Launch")
                    if !conversionData.keys.contains("deep_link_value") && conversionData.keys.contains("fruit_name"){
                        switch conversionData["fruit_name"] {
                            case let fruitNameStr as String:
                            NSLog("This is a deferred deep link opened using conversion data")
                            walkToSceneWithParams(fruitName: fruitNameStr, deepLinkData: conversionData)
                                NSLog("Could not extract deep_link_value or fruit_name from deep link object using conversion data")
                } else {
                    NSLog("[AFSDK] Not First Launch")
    func onConversionDataFail(_ error: Error) {
        NSLog("[AFSDK] \(error)")

⇲ Github リンク:Swift




The following testing scenario demonstrates the handling of deferred deep linking from links that contain custom parameters but not deep_link_value and deep_link_sub1-10 parameters.
This testing scenario is also relevant for all extended deferred deep linking described earlier.

Before you begin

The test link



  • リンクのドメインとOneLinkテンプレートのみを使用してください。
    例: {0}
  • Add OneLink custom parameters other than deep_link_value and deep_link_sub1-10, as expected by your application.
  • パラメータは、クエリパラメータとして追加する必要があります。

    • 例:

Perform the test

  • 端末でリンクをクリックします。
  • AppsFlyer管理画面で設定されたOneLinkの設定内容を基に、App StoreまたはWebサイトのいずれかにリダイレクトします。
  • アプリをインストールします。


    • アプリがまだ開発中で、まだストアにアップロードされていない場合は、次の画像が表示されます:
    • - Xcodeまたは使用する他のIDEからアプリケーションをインストールします。
  • UDL detects the deferred deep linking, matches the install to the click, and retrieves the OneLink parameters to didResolveDeepLink callback. UDL will not find any parameters to route and exit.
  • onConversionDataSuccess callback is called with the conversion data, which holds both custom parameters and attribution data.
  • onConversionDataSuccess sets the custom parameters to route the user inside the application.

Expected logs results


📘 以下のログは、[デバッグモードが有効な場合]( のみ使用できます。

  • SDKが初期化された場合:

    [AppsFlyerSDK] [] AppsFlyer SDK version 6.6.0 started build 
  • UDL APIの開始:

    [AppsFlyerSDK] [com.appsflyer.serial] [DDL] Start DDL
  • UDL sends query to AppsFlyer service to query a match with this install:

    [AppsFlyerSDK] [com.appsflyer.serial] [DDL] URL:
  • UDL は応答を受け取り、呼び出します didResolveDeepLink コールバック status=FOUND およびOneLinkリンクデータ:

    [AppsFlyerSDK] [com.appsflyer.serial] [DDL] Calling didResolveDeepLink with: {"af_sub4":"","click_http_referrer":"","af_sub1":"","click_event":{"af_sub4":"","click_http_referrer":"","af_sub1":"","af_sub3":"","deep_link_value":"","campaign":"","match_type":"probabilistic","af_sub5":"","campaign_id":"","media_source":"","af_sub2":""},"af_sub3":"","deep_link_value":"","campaign":"","match_type":"probabilistic","af_sub5":"","media_source":"","campaign_id":"","af_sub2":""}
  • GCDがコンバージョンデータを取得:

[AppsFlyerSDK] [com.appsflyer.serial] [GCD-B01] GCD 4.0 URL:*****4&device_id=1672050642148-9221195
  • onConversionDataSuccess is called with conversion data as input:
[AppsFlyerSDK] [com.appsflyer.serial] [GCD-A02] -[basic_app.AppDelegate onConversionDataSuccess:]: