Unity3D中的Facebook Deep Link等于null

问题描述

问题-为什么Unity3D中的Facebook Deep Link总是为空?在Android Studio中工作的同事从未遇到过此类问题。我认为仅仅是Unity的Facebook SDK是用棍子和拐杖制成的,因为两周来我无法用它实现绝对的任何事情。这是完全失败。

Unity3D版本: 2019.3.0f5

Facebook SDK版本: 7.21.2

我的动作顺序:

  1. 我将数据从Unity复制到了我的Facebook应用程序 enter image description here

  2. 我在Facebook设置中添加了该方案,并重新生成了AndroidManifest enter image description here

  3. 我将其添加到AndroidManifest中是因为我看到该单元的Deep Links Unity帮助也有它 enter image description here

  4. 在应用程序的Facebook设置中,我还启用了深度链接 enter image description here

  5. 我的代码

    void Awake()
    {
    if (FB.IsInitialized)
            FB.ActivateApp();
        else
        {
            FB.Init(() => {
                FB.ActivateApp();
            });
        }
    }
    
    public void Click()
    {
        FB.Mobile.FetchDeferredAppLinkData(DeepLinkCallback);
    }
    
    void DeepLinkCallback(IAppLinkResult result)
    {
        if (!string.IsNullOrEmpty(result.Url))
        {
            _floats.DeepLink = result.Url; // Deep Link = null (????????????)
            Debug.Log("Deep Link: " + _floats.DeepLink);
        }
        SceneManager.LoadScene(2);
    }
    
    void Update()
    {
        DontDestroyOnLoad(this);
    }
    
  6. 我使用Facebook Deep Link Tester测试了Deep Link。深度链接看起来像这样:

SS:// testDeep

  1. Facebook记录了以下“深层链接”,尽管并非没有想象中的错误

enter image description here

enter image description here

  1. 但是,DeepLink变量仍然为空。那里什么都没有。空值。 但是在编辑器中,变量不为空: enter image description here

  2. 从AndroidManifest和Facebook设置中删除方案也无济于事。另外,我尝试启用“本地或桌面应用程序?”。在Facebook应用程序设置中,但这也没用

解决方法

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

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

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