单目的深度估计_深度链接的目的是什么?

单目的深度估计

If you’re a mobile developer, you should be familiar with deep links. They bring a navigation mechanism to your application. With them, you can both:

如果您是移动开发人员,则应该熟悉深层链接。 它们为您的应用程序带来了导航机制。 通过它们,您可以:

  • Redirect your users from anywhere towards your mobile application.

    将您的用户从任何地方重定向到您的移动应用程序。
  • Navigate inside your mobile app to specific pages.

    在您的移动应用程序内导航到特定页面。

So why are people often confused about them? And why is it so important to be accurate when communicating about deep links?

那么为什么人们经常对他们感到困惑? 为什么在进行深层链接交流时保持准确性如此重要?

To answer the first question, I’ll need to explain what deep links are and how they behave. Since there are different types of deep links, you’ll want to dig deeper to clear the confusion.

要回答第一个问题,我需要解释什么是深层链接以及它们的行为方式。 由于存在不同类型的深层链接,因此您将需要更深入地挖掘以消除混乱。

Because that’s what leads to the second point: Deep links can be turned into a powerful weapon to deal with acquisition and retention. They draw your users towards your application.

因为这就是第二点:深层链接可以变成处理获取和保留的强大武器。 他们将用户吸引到您的应用程序中。

To that end, you’ll deal with non-technical people — mostly from your product/marketing team. You must pay attention to how you communicate your needs. Otherwise, you’ll end up delivering something unexpected.

为此,您将与非技术人员打交道-主要是来自您的产品/营销团队。 您必须注意如何传达您的需求。 否则,您最终将交付意外的东西。

Let’s untangle what these links are and how to exploit them.

让我们解开这些链接是什么以及如何利用它们。

深层链接有哪些不同类型? (What Are the Different Types of Deep Links?)

You can see deep links as flagged URLs opening your mobile application instead of a browser. We can put them in three categories.

您可以将深层链接视为标记为URL的URL,它们可以打开您的移动应用程序而不是浏览器。 我们可以将它们分为三类。

1.深层链接 (1. Deep links)

You can spot them by their syntax: They start with a custom scheme of your choosing. Let’s compare with a regular URL:

您可以通过它们的语法来发现它们:它们以您选择的自定义方案开始。 让我们与常规网址进行比较:

https://www.myawesomewebsite.com/amazingpath  // Regular URL
mycustomscheme://myawesomewebsite/amazingpath // Deep link URL

Look at deep links as tailored URLs for your application.

将深层链接视为适合您的应用程序的URL。

2.通用链接 (2. Universal links)

Apple first introduced universal links for iOS 9. They provide seamless navigation on your mobile phone when navigating on your browser.

Apple首先引入了iOS 9的通用链接 。当您在浏览器中导航时,它们可在您的手机上提供无缝导航。

In essence, they’re regular URLs — such as the one in the example above — that you own. Imagine you have a web application besides your mobile app. You may want to redirect your user to your mobile app while browsing inside your web application.

从本质上讲,它们是您拥有的常规URL(例如上例中的URL)。 假设您的移动应用程序之外还有一个Web应用程序。 您可能需要在Web应用程序内部浏览时将用户重定向到您的移动应用程序。

Like with deep links, you must declare this URL inside your mobile application. Besides, your web application must certify that it allows your mobile app to intercept its URLs. Otherwise, it would be a significant security breach. Imagine you declare Google as a universal link. Each time your user opens Google on a mobile browser, your mobile app will fire up instead!

与深层链接一样,您必须在移动应用程序内部声明此URL。 此外,您的Web应用程序必须证明它允许您的移动应用程序拦截其URL。 否则,这将是严重的安全漏洞。 假设您将Google声明为通用链接。 每次用户在移动浏览器上打开Goog​​le时,您的移动应用都会启动!

The certification takes the form of a JSON file you must upload inside the .well-known folder at the root of your web application. Depending on which platform you’re developing for, the file will bear a different name:

认证采用JSON文件的形式,您必须将其上传到Web应用程序根目录下的.well-known文件夹中。 根据您要开发的平台,文件将使用不同的名称:

  • apple-app-site-association.json for iOS

    适用于iOS的 apple-app-site-association.json

  • assetlinks.json for Android

    assetlinks.jsonAndroid的 assetlinks.json

3.应用程式连结 (3. App links)

They’re nothing more than the term Android developers use for universal links. If you want to use this term among Android developers, that’s fine. But for your audience’s sanity, I’d recommend shunning this name and sticking to universal links.

它们不过是Android开发人员用于通用链接的术语。 如果您想在Android开发人员中使用此术语,那很好。 但是出于听众的头脑,我建议您避免使用此名称,并坚持使用通用链接。

它们如何工作? (How Do They Work?)

We can split how to approach them into two phases.

我们可以将如何处理它们分为两个阶段。

1.检测 (1. Detection)

The detection phase relies on whether your mobile application supports the deep link — or universal link, for that matter. You must declare that you support the given link inside your mobile app.

检测阶段取决于您的移动应用程序是否支持深度链接或通用链接。 您必须声明支持移动应用程序内的给定链接。

You must declare a pair containing a scheme (in red below) and a host (in green). Both must match if you want your mobile application to intercept the link.

您必须声明一个包含方案(以下为红色)和主机(为绿色)的对。 如果您想让您的移动应用程序拦截链接,则两者都必须匹配。

Image for post
Photo by the author.
图片由作者提供。

However, when your mobile app intercepts a link, it will behave differently depending on whether it’s a deep link or a universal link. I’ve illustrated the two cases below:

但是,当您的移动应用截获链接时,其行为将有所不同,具体取决于它是深层链接还是通用链接。 我已经说明了以下两种情况:

Image for post
Photo by the author.
图片由作者提供。

We can observe how straightforward deep links are. Either they open your mobile app provided there is a match or they do nothing.

我们可以观察到深层链接是多么简单。 如果存在匹配项,他们要么打开您的移动应用程序,要么什么都不做。

For universal links, it’s trickier. The main advantage lies in the fallback in case your mobile app doesn’t support the URL. It will open the browser since the link remains a regular URL.

对于通用链接,这比较棘手。 如果您的移动应用程序不支持URL,则主要优势在于可以回退。 由于链接仍然是常规URL,因此它将打开浏览器。

If your mobile app supports the URL, the system will perform a check to ensure your certificate is valid. Your mobile app will intercept the link and open itself or fall back to the browser.

如果您的移动应用程序支持URL,则系统将执行检查以确保您的证书有效。 您的移动应用程序将拦截该链接并打开自身,或退回到浏览器。

However, the Android operating system behaves differently. Even if the certificate is not conclusive, the system will prompt a disambiguation dialog to let the user chose how to proceed. So you could still open your mobile app if you don’t certify your universal link inside your web app.

但是,Android操作系统的行为有所不同。 即使证书不是确定性的,系统也会提示清除歧义对话框,让用户选择如何进行。 因此,如果您不验证Web应用程序中的通用链接,仍然可以打开移动应用程序。

2.解析 (2. Parsing)

So far, your mobile app can intercept all URLs matching both the scheme and host you’re supporting. With nothing else, your app will merely launch and land on your home page. You’ll want to redirect your user to a specific page inside your mobile app.

到目前为止,您的移动应用可以拦截与您支持的方案和主机匹配的所有URL。 除此之外,您的应用只会启动并登陆您的主页。 您需要将用户重定向到移动应用程序内的特定页面。

For this, you’ll need to parse the path attached to your URL (in blue above). Depending on it, your app must handle the routing to your page. This part is entirely up to the developer.

为此,您需要解析URL上附加的路径(上面的蓝色)。 取决于它,您的应用程序必须处理到页面的路由。 这部分完全取决于开发人员。

深度链接与通用链接处理 (Deep link vs. universal link handling)

When you want to support either a deep link or a universal link, you’ll always have to tackle both the detection and parsing steps. But consider this:

当您想要支持深层链接或通用链接时,您将始终必须处理检测步骤和解析步骤。 但是考虑一下:

  • Functionally speaking, you won’t see any difference between them.

    从功能上讲,它们之间不会有任何区别。
  • Technically speaking, the detection part will be similar. However, the parsing will differ because of their URL format, involving an additional cost for the developer.

    从技术上讲,检测部分将是相似的。 但是,由于URL格式的原因,解析会有所不同,这涉及开发人员的额外费用。

添加深层/通用链接的成本是多少? (What’s the Cost to Add a Deep/Universal Link?)

The detection part won’t cost much. The developer needs to add the newly supported URL inside the mobile app’s manifest. The task revolves around the parsing and routing to the wanted destination in your mobile application.

检测部分不会花费太多。 开发人员需要在移动应用程序清单中添加新支持的URL。 该任务围绕解析和路由到移动应用程序中的所需目标进行。

If you’re developing for iOS and you want to support another universal link, you’ll need to update your certifying JSON file and reupload it on your web application. You don’t need this step for the Android platform.

如果您正在为iOS开发,并且希望支持另一个通用链接,则需要更新认证JSON文件并将其重新上传到Web应用程序中。 对于Android平台,您不需要此步骤。

如何在深层链接或通用链接之间进行选择 (How to Choose Between a Deep Link or Universal Link)

Even though these links share a common goal — to redirect your user inside your mobile app — they have different purposes.

尽管这些链接有一个共同的目标(即在移动应用程序内部重定向用户),但它们有不同的目的。

Before the introduction of universal links, deep links were the only available tool to fill out this role. Now both are complementary.

在引入通用链接之前,深层链接是填补这一角色的唯一可用工具。 现在两者是互补的。

You’ll want to support universal links for global communication around your product. They ensure proper redirection to either your mobile or web app.

您将需要支持用于产品周围全球通信的通用链接。 它们可确保正确重定向到您的移动应用程序或Web应用程序。

You’ll prefer deep links for targeting communication for your mobile app only. You can imagine the following scenarios:

您将更喜欢深层链接,仅用于移动应用程序的定向通信。 您可以想象以下情形:

  • Insert a deep link inside the push notification payload.

    在推送通知有效内容内插入一个深层链接。
  • Include a deep link in a mailing campaign to reactivate your users.

    在邮件广告系列中包含深层链接以重新激活您的用户。
  • Have an API send you a deep link to let your mobile app know where to navigate on a specific event.

    让API向您发送深层链接,以使您的移动应用知道特定事件的导航位置。

结论 (Conclusion)

With these guidelines in mind, I hope you better grasp the concept of deep linking and what lies behind the links.

牢记这些指导原则,希望您能更好地理解深度链接的概念以及链接背后的含义。

As you’ve seen, there’s nothing complicated about them as long as you understand their nuances and how to use them. But please make sure to adopt the proper terms when talking to the different teams involved.

正如您所看到的,只要您了解它们的细微差别以及如何使用它们,它们就没有什么复杂的了。 但是,在与涉及的不同团队交谈时,请确保采用适当的条款。

翻译自: https://medium.com/better-programming/what-are-the-different-purposes-of-deep-links-253ee1118b06

单目的深度估计

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值