Facebook iOS 延迟链接 `url` 总是返回 `nil` 更新:

问题描述

任何人都可以帮助我??,我正在尝试将 Facebook 的延迟链接与该功能一起使用:

 AppLinkUtility.fetchDeferredAppLink { (url,error) in ... } 

不管我怎么写代码,url总是nil

重现此问题所需的步骤是什么? 描述起来很简单:
1- 登录您的 Facebook
2- 然后点击https://developers.facebook.com/tools/app-ads-helper
2- 从下拉列表中选择要测试的应用。
3- 点击提交。
4- 在底部,您会在开发人员工具下找到“Deep Link Tester”。
5- 点击“测试深层链接”,然后在对话框中输入深层链接。
6- 选择“发送通知”和“发送延迟”复选标记。
7- 然后你会收到一个通知到你的 facebook 应用程序。
8- 点按通知,即可打开 App Store。
9- 通过 Xcode 安装应用程序。

然后在我的代码中我尝试了至少 5 个变体:

例如我试过这个:

func application(_ application: UIApplication,didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

        // Set the trackings to true in test mode
        Settings.setAdvertiserTrackingEnabled(true)
        Settings.isAdvertiserIDCollectionEnabled = true
        Settings.isAutoLogAppEventsEnabled = true

        // Initialize the Facebook SDK
        ApplicationDelegate.initializeSDK(nil)

        AppLinkUtility.fetchDeferredAppLink { (url,error) in
            if let url = url {
                print(url)
            }
            print(error as Any)
        }
}

无论我尝试哪种变体,结果总是一样的,url = nil

我正在使用:

  • Xcode 版本:12.4
  • Swift 版本:5.2
  • 使用 SPM 安装 Facebook SDK

我之前进行了一些搜索,但对我没有任何作用:
(不工作)。
iOS - Test getting Facebook deferred deep link

(也不起作用)
How to use Facebook deferred deep linking feature for new installs and to test the same before publishing iOS App to appStore?

(不是我的情况)
iOS - Test getting Facebook deferred deep link

(现在情况不同,我们必须执行用户的 IDFA 同意)
Facebook deferred deep link on iOS not working

(没有答案)
https://developer.apple.com/forums/thread/77046 https://developers.facebook.com/community/threads/304205737647076/?locale=es_LA

特别说明:
此代码:ATTrackingManager.requestTrackingAuthorization(completionHandler:) 在真实设备(iPhone 12 和 iPhone SE(第二代)iOS 14.4)中从不显示提示并始终返回 denied。我不知道这对这个问题是否重要,但我认为提及这一点很重要

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)