微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Unity3D中的Facebook Deep Link等于null

如何解决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 举报,一经查实,本站将立刻删除。