Firebase动态链接生成器中的DFL参数 [英] DFL parameter in Firebase Dynamic Links Builder

查看:226
本文介绍了Firebase动态链接生成器中的DFL参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用Android上的动态链接生成器API以编程方式构建动态链接( https://firebase.google.com/docs/dynamic-links/android/create )。这是唯一的选择适用于我的情况,因为我需要跟踪点击数据并缩短链接。

这个链接可以在桌面上打开,但问题是,链接将仅适用于移动应用程序 - 网站无法识别此链接(此行为是故意的)。我想将桌面用户导向到网站的主页面。

这里是Firebase文档的引用:

lockquote

当用户打开动态在桌面Web浏览器上链接,他们将加载这个URL(除非指定了参数dfl)。如果您没有与链接内容等同的Web,则URL不需要指向有效的Web资源。在这种情况下,你应该设置一个从这个URL重定向到,例如,你的主页。

我看到我需要 dfl 参数。 ( dfl是在桌面上打开的链接,覆盖param链接。)如何使用Android上的动态链接生成器指定 dfl 参数?



我知道我可以通过手动构建动态链接来指定 dfl https://firebase.google.com/docs/dynamic-links/create-manually
但是这个方法对我来说没有用,因为它有这样的限制: 如果您不需要跟踪Firebase控制台中的点击数据,并且不关心这些链接是否很长,那么...


有没有人知道正确的解决方案或一些技巧来达到这个目的?任何想法/想法将不胜感激!

解决方案



当构建者编写Uri时,我附加了& dfl = XXXXX



当我试图在浏览器PC上打开这个链接时在 dfl 参数中引导我访问URL,但是在设备上,它会打开Play商店或应用(如果已安装)。



这样的方法让我困惑,但是找到了解决方法。

I need to programmatically build a dynamic link using the Dynamic Link Builder API on Android (https://firebase.google.com/docs/dynamic-links/android/create). This is the only option applicable for my case since I need to track click data and shorten links.

This link can be opened on the desktop, but the problem is that the link will be eligible only for mobile apps - the website is unable to recognize this link (this behavior is intentional). I would like the desktop user is directed to the website's main page.

Here is the quote from Firebase doc:

When users open a Dynamic Link on a desktop web browser, they will load this URL (unless param dfl is specified). If you don't have a web equivalent to the linked content, the URL doesn't need to point to a valid web resource. In this situation, you should set up a redirect from this URL to, for example, your home page.

I see I need dfl parameter. (dfl is The link to open on desktop, overriding param link.) How can I specify dfl parameter using Dynamic Links Builder on Android?

I know that I can specify dfl by building dynamic link manually - https://firebase.google.com/docs/dynamic-links/create-manually But this approach is not useful for me since it has such constraints:

If you don't need to track click data in the Firebase console and you don't care if the links are long...

Does anybody know the right solution or some trick to achieve this? Any thoughts/ideas would be appreciated!

解决方案

Seems, that simple appending does work...

When the builder composes the Uri, I append it with &dfl=XXXXX

When I try to open this link on browser PC it directs me to URL in dfl parameter, but on the device, it opens Play Store or app (if it's installed).

The absence of such method confused me, but the solution is found.

这篇关于Firebase动态链接生成器中的DFL参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆