如何使用我自己的域名缩短Firebase动态链接 [英] How to shorten a Firebase Dynamic Link using my own domain name

查看:174
本文介绍了如何使用我自己的域名缩短Firebase动态链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在iOS应用中实施 Firebase动态链接。目标是为营销目的提供一个干净的URL,以便人们可以在社交媒体上分享链接。这个想法是人们将共享以我的域名开头的干净的URL。

I'm trying to implement Firebase Dynamic Links in an iOS app. The goal is to have a clean URL for marketing purposes so folks can share links on social media. The idea is folks will share the clean URL that starts with my domain name.

点击该链接后安装应用程序时,我们希望能够通过查看Firebase提供的有效负载来跟踪推荐应用安装的用户。我认为此目标类似于Firebase的用例将网络用户转换为移动应用用户。

When the app is installed following a click on that link, we want to be able to track who referred the app install by looking at the payload delivered by Firebase. I think this goal is similar to Firebase's use case to convert web users to mobile app users.

我想在社交媒体上分享的示例链接是: http://example.com/my-payload-here

An example link I would like to provide for sharing on social media is: http://example.com/my-payload-here

我是尝试了几个案例,但我无法在任何情况下得到我正在寻找的行为。有没有人以前成功实现过这个?

I've tried several cases but I'm not able to get the behavior I'm looking for in any case. Has anyone implemented this successfully before?

这是我的测试程序:


  1. 卸载应用程序

  2. 将要在iMessage中测试的链接发送给自己

  3. 点击iOS设备上的链接(不使用模拟器)

  4. 从App Store安装应用程序

  5. 通过点击App Store中的打开按钮,在下载完成后启动应用程序

  1. Uninstall the app
  2. Send the link to be tested in an iMessage to myself
  3. Tap the link on my iOS device (not using a simulator)
  4. Install the app from the App Store
  5. Launch the app after download completes by tapping "Open" button in the App Store

以下是我的调查结果:


  1. Firebase控制台生成的短链接 https://xyz.app.goo.gl/ABCD ) - 链接在App Store中打开。我安装了应用程序。当我在安装后启动应用程序时,不会传递有效负载。如果我退出应用程序,请返回iMessage中的链接,然后再次启动,交付有效负载。

  1. Short link generated from the Firebase Console (https://xyz.app.goo.gl/ABCD) - Link opens in App Store. I install the app. When I launch the app after installing, the payload is not delivered. If I quit out of the app, go back to the link in iMessage, and launch a second time, the payload is delivered.

长链接与Firebase控制台中的长动态链接相同,用于在#1中生成的链接 https ://xyz.app.goo.gl/?link = http://example.com/my-payload-here& isi = 12345& ibi = com.example.MyApp ) - 行为与#相同1

Long link identical to the "Long Dynamic Link" from the Firebase console for the link generated in #1 (https://xyz.app.goo.gl/?link=http://example.com/my-payload-here&isi=12345&ibi=com.example.MyApp) - behavior is identical to #1

使用我的域名的短链接 http://example.com/redirect/my-payload-here ,配置为301重定向到#2中的URL) - 在App Store中打开。我安装。在安装后启动应用程序时,不会传递有效内容。如果我退出应用程序,请返回iMessage中的链接,然后再次启动,该链接仍会转到App Store。

Short link using my domain (http://example.com/redirect/my-payload-here, configured to 301 redirect to URL in #2) - Opens in App Store. I install. When I launch the app after installing, the payload is not delivered. If I quit out of the app, go back to the link in iMessage, and launch a second time, the link still goes to the App Store.

我有些问题:


  1. 为什么在案例1和案例2的首次启动时没有交付有效载荷?

  2. 我们如何才能启动应用并提供有效负载而不是去App Store?

我还咨询了 Firebase流程图,用于案例2中的深层链接。

I've also consulted the Firebase flowchart for the deep link in case 2.

推荐答案

Firebase目前无法实现此目的。如果您需要带有白标的网址,则需要< a href =https://hackernoon.com/the-death-of-deep-linking-6cc65eb33e28#.68r6xqhl7 =nofollow noreferrer>自己构建或使用更强大的链接平台,如< a href =https://branch.io =nofollow noreferrer> Branch.io (完全披露:我在分支团队中)。

This is not currently possible with Firebase. If you need whitelabeled URLs, you either need to build it yourself or use a more powerful link platform like Branch.io (full disclosure: I'm on the Branch team).

具体回答您的问题:


  1. 我已经在testbed应用程序中实现了Firebase动态链接,并且可以通过安装确认链接第一次 适用于长和短URL变体。您的 AppDelegate 配置可能存在问题,因此如果您想共享代码,我们可以查看一下。

  2. Firebase不支持自定义域名这次。从理论上讲(如果你能解决上面的第一个问题),你可以通过使用你尝试过的重定向来实现首次安装。但是,一旦安装了应用,您将永远无法使用Firebase链接数据启动应用 。这是因为Universal Links基于链接的域工作,甚至不请求Web目标。即使您在自己的域上手动启用通用链接,该应用也会立即打开而不会调用Firebase,并且永远不会设置链接数据。

  1. I have implemented Firebase Dynamic Links in a testbed app and can confirm that linking through installation the first time does work for both long and short URL variants. There is likely something wrong with your AppDelegate config, so we can take a look at that if you want to share code.
  2. Firebase does not support custom domains at this time. In theory (if you can solve the first issue above) you could get this working for first install by using a redirect like you have tried. However, you'll never be able to get it to launch the app with Firebase link data once the app is installed. This is because Universal Links work based on the domain of the link, and don't even request the web destination. Even if you enable Universal Links manually on your own domain, the app will open immediately without ever calling Firebase and the link data will never be set.

这篇关于如何使用我自己的域名缩短Firebase动态链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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