iOS 10 Universal Links(通用连接),从微信网页连接跳转到公司APP之官方指南翻译

本文翻译了苹果官方关于Universal Links的指南,介绍了如何实现在iOS 9及以上系统中,用户点击链接直接跳转到已安装的App,而非通过Safari。通用链接具有唯一性、安全性和便捷性,避免了自定义URL schemes在微信中被屏蔽的问题。文章详细阐述了创建和上传apple-app-site-association文件,以及如何在App中处理通用链接的步骤。
摘要由CSDN通过智能技术生成

苹果官网翻译

1.点击下面官网详解英文版—苹果官网Universal Links详解

支持通用连接

When you support universal links, iOS 9 users can tap a link to your website and get seamlessly redirected to your installed app without going through Safari. If your app isn’t installed, tapping a link to your website opens your website in Safari.

如果你的app支持通用链接,那么iOS 9用户点击链接到你的网站,可以准确地定位到到手机安装的你的APP应用程序,而不通过Safari去实现。如果用户手机没有安装你的APP应用程序,通过通用连接能利用一个链接到你的网站,而不用通过在Safari打开你的网站。

Universal links give you several key benefits that you don’t get when you use custom URL schemes. Specifically, universal links are:

通用链接给你如下几个关键的好处,让你不必使用自定义 URL schemes来实现(这种实现方式已经被微信给屏蔽了,所以说通过自定义链接协议头的方式在微信里加载网页,点击网页跳转到APP,已经不可能了)。具体来说,好处是:

1.Unique.唯一性

Unlike custom URL schemes, universal links can’t be claimed by other apps, because they use standard HTTP or HTTPS links to your website.

不像自定义URL schemes协议头那样,通用的链接不能被其他应用程序声称,因为他们使用标准HTTP或HTTPS链接你的网站。

2.安全

When users install your app, iOS checks a file that you’ve uploaded to your web server to make sure that your website allows your app to open URLs on its behalf. Only you can create and upload this file, so the association of your website with your app is secure.

如果iOS用户安装了你的应用,应用程序启动(不是登陆)时就会检查你上传到web服务器json文件(apple-app-site-association),以确保你的网站允许应用程序打开url。只有你能创建和上传这个文件,所以专门配置的网站与你的应用程序连接之间是安全的。

3.方便,自由性

Universal links work even when your app is not installed. When your app isn’t installed, tapping a link to your website opens the content in Safari, as users expect.

触发通用连接时,如果用户没有安装你的应用程序,点击这个通用连接会打开Safari加载你的网站内容,这是用户所期望。

4.简单

One URL works for both your website and your app.

只需一个URL就能根据用户有没有安装你的APP,决定加载你的网站还是你的APP应用程序

5.私有性。

Other apps can communicate with your app without needing to know whether your app is installed.

其他应用程序可以与你的应用程序通信,而不需要知道你的应用程序是否在用户手机中安装。

注意:

NOTE

In iOS 9 and later, universal links let users open your app when they tap links to your website within WKWebView and UIWebView views and Safari pages, in addition to links that result in a call to openURL:, such as those that occur in Mail, Messages, and other apps.

When a user is browsing your website in Safari and they tap a universal link to a URL in the same domain as the current webpage, iOS respects the user’s most likely intent and opens the link in Safari. If the user taps a universal link to a URL in a different domain, iOS opens the link in your app.

For users who are running versions of iOS earlier than 9.0, tapping a universal link to your website opens the link in Safari.

iOS中9,后来,用通用链接让用户打开你的应用时,点击链接到你的网站内,可以使用WKWebView和UIWebView视图和Safari网页来实现,除了调用openURL链接:比如那些发生在邮件、消息和其他应用程序,这些途径是不能实现的。

用户在Safari浏览你的网站,可以利用这个通用链接实现一个相同的域名URL来加载当前网页,iOS尊重用户的最有可能的意图和使用Safari打开链接。如果用户通用链接到一个在图通域名的URL,iOS将在你的应用程序打开链接(这个功能类似于知乎APP)。

iOS的用户正在运行的iOS系统版本比9.0低,网页出发的通用链接会在Safari浏览器打开你的网站链接,而不会触发打开你的APP(也就是手机系统必须是iOS9.0以上)。

Adding support for universal links is easy. There are three steps you need to take:

1.Create an apple-app-site-association file that contains JSON data about the URLs that your app can handle.

2.Upload the apple-app-site-association file to your HTTPS web server. You can place the file at the root 
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值