iOS上的通用链接与深层链接(URL方案) [英] Universal links on iOS vs. deep links (URL schemes)

查看:775
本文介绍了iOS上的通用链接与深层链接(URL方案)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如我正在阅读的那样,iOS 9引入了Universal Links。在Apple的应用搜索编程中的支持通用链接部分指南,它说这与URL方案的深层链接不完全相同,但我对这个主题并不完全清楚:

As I'm reading, iOS 9 introduced Universal Links. In the "Support Universal Links" section in Apple's App Search Programming Guide, it says that this is not exactly like deep linking with URL schemes, but I'm not totally clear about this topic:


  • Universal Link和URL Schemes之间的实际差异是什么?环球链接仅适用于网站,邮件或消息应用程序中的超链接吗?

  • 通用链接是否取代了URL方案?

  • 是Universal Links是一种深层链接?

推荐答案

通用链接是iOS发送网络的能力url请求给定的应用程序,而不是在浏览器中打开它们。

Universal links is the iOS's capability of sending web url request to a given app, instead of opening them in the browser.

URL-schemes是一种应用程序能够在给定状态下打开,由url描述,以及由开发人员在代码中处理。

URL-schemes is an apps ability to open in a given state, described by the url, and handled in code by the developer.

假设您有一个名为Cool App的应用,并且您已经注册了url-scheme
coolapp。你的应用程序有不同的区域,如漂亮的小工具和漂亮的东西。
现在,您可以通过链接 coolapp:// nice-gadgets 打开您的应用。要在好的小工具部分打开应用,您必须实现 application(_:openURL:options:) 方法,并在此内发现请求的url ,并让应用程序打开请求的视图控制器。

Say you have an app called "Cool App", and you've registed the url-scheme "coolapp". And your app have different areas like "Nice gadgets" and "Nice stuff". Now you can open your app with at link link coolapp://nice-gadgets. To make the app open on the nice gadget section, you have to implement the application(_:openURL:options:) method, and within this discover the requested url, and make the app open the requested view controller.

同时你有一个名为 www.coolapp.com 。当使用iOS设备浏览时,您会看到指向您网站的链接 - 例如 www.coolapp.com/nice-gadgets ,并打开该链接,它将在浏览器。
通过启用通用链接,它将通过调用 application(_:continueUserActivity:restorationHandler:) 给定url作为参数的方法。
从这里你可以使用url方案处理中的相同逻辑来打开处于请求状态的应用程序。

At the same time you have a website called www.coolapp.com. When browsing using an iOS device, and you come across a link to your site - say www.coolapp.com/nice-gadgets, and opening the link, it will open in the browser. By enabling universal links it will open the app instead by calling the application(_:continueUserActivity:restorationHandler:) method given the url as parameter. From here you can use the same logic from the url scheme handling, to open the app in the requested state.

那么通用链接会取代url方案吗?我对此表示怀疑,但他们会以一种很好的方式相互称赞。

So will universal links replace url schemes? I doubt it, but they are going to compliments each other in a nice way.

通用链接是否是深层链接?不,但他们可以启动在应用程序中使用深层链接的过程。

Are universal links deep links? No, but they can initiate the process of using deep links within an app.

这篇关于iOS上的通用链接与深层链接(URL方案)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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