如何在Unity动态链接中添加额外的参数?

时间:2019-07-11 20:20:31

标签: firebase unity3d firebase-dynamic-links

我正在尝试通过Firebase动态链接(例如,一个小的字符串)发送少量数据,然后,如果用户安装了该应用程序,请打开某个页面并对该字符串进行操作,第一部分可以正常工作,但我无法访问该字符串,甚至无法发送它,

像这样:https://mycoolapp.com/welcome/1234

//此Var是DynamicLinkComponents(类似于firebase中的参考指南)

var mylinkFireBase = new Firebase.DynamicLinks.DynamicLinkComponents(new System.Uri("https://mycoolapp.page.link/fdga" ), "https://mycoolapp.com/welcome")
        {
            IOSParameters = new Firebase.DynamicLinks.IOSParameters("com.mycoolapp.mobile"),
            AndroidParameters = new Firebase.DynamicLinks.AndroidParameters("com.mycoolapp.mobile"),
        };

//这是短动态链接(如firebase中的参考指南)

   var options = new Firebase.DynamicLinks.DynamicLinkOptions
        {
            PathLength = DynamicLinkPathLength.Unguessable
        };

        DynamicLinks.GetShortLinkAsync(mylinkFireBase, options).ContinueWith((task) =>
        {
            if (task.IsCanceled)
            {
                Debug.LogError("GetShortLinkAsync was canceled.");
                return;
            }
            if (task.IsFaulted)
            {
                Debug.LogError("GetShortLinkAsync encountered an error: " + task.Exception);
                return;
            }

            ShortDynamicLink link = new ShortDynamicLink();
            link = task.Result;
            Debug.LogFormat("Generated short link {0}", link.Url);

        });

LINK URL返回此:

"Generated short link https://https//mycoolapp.com/welcome/?afl=&amv=0&apn=com.mycoolapp.mobile&ibi=com.mycoolapp.mobile&ifl=&ipfl=&link=https://mycoolapp.page.link/fdga"

然后我尝试在行中放入邀请代码字符串:

var mylinkFireBase = new Firebase.DynamicLinks.DynamicLinkComponents(new System.Uri("https://mycoolapp.page.link/fdga" ), "https://mycoolapp.com/welcome" + "?offer="" + InvitationCode.text + "&apn=com.mycoolapp.mobile" )

但是,我无法使用我要发送的字符串

0 个答案:

没有答案