[英]I have uploaded apple-app-site-association on my server, which I use for backend services
Where can I upload 'apple-app-site-association' for universal link setup in my iOS app?. 我可以在哪里上传“ apple-app-site-association”以在我的iOS应用中进行通用链接设置?
How can I use universal link in my iOS app?. 如何在我的iOS应用中使用通用链接? I am getting just confuse to read a lot of tutorials. 我变得很困惑,无法阅读很多教程。 Can anyone help me? 谁能帮我?
You need to upload apple-app-site-association file to the root directory of the server(from where you need to redirect to your installed app). 您需要将apple-app-site-association文件上传到服务器的根目录(需要从该目录重定向到已安装的应用程序)。
eg- Suppose you have to redirect from www.abc.com/getapp then you need to upload the apple-app-site-association file to the root directory where the www.abc.com is get hosted. 例如,假设您必须从www.abc.com/getapp重定向,那么您需要将apple-app-site-association文件上载到承载www.abc.com的根目录中。
Steps to support universal links- 支持通用链接的步骤-
Create your apple-app-site-association file(Suppose your universal link is www.abc.com/getapp and you want to redirect in your app from here). 创建您的apple-app-site-association文件(假设您的通用链接为www.abc.com/getapp,并且您想从此处重定向应用程序)。
{ "applinks": { "apps": [], "details": [ { "appID": "9JA89QQLNQ.com.apple.wwdc", //9JA89QQLNQ is your team ID & com.apple.wwdc is your bundle id "paths": [ "/getapp"] } ] } }
Upload this file to the root directory where www.abc.com is hosted. 将此文件上传到托管www.abc.com的根目录。
Now prepare your app to support universal links- 现在准备您的应用程序以支持通用链接-
a. 一种。 Go to developer.apple.com and enable Associated Domains to your app ID. 转到developer.apple.com并为您的应用程序ID启用关联域。
b. 湾 Select your target and turn on Associated Domains switch. 选择目标,然后打开“关联域”开关。
c. C。 Add applinks:abc.com
. 添加applinks:abc.com
。
d. d。 Add application:continueUserActivity:restorationHandler:
app delegate method so that your app can receive a link and handle it appropriately. 添加application:continueUserActivity:restorationHandler:
应用程序委托方法,以便您的应用程序可以接收链接并适当地处理它。
Not getting callback to the app- 没有回调到应用程序-
1.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. 1.当用户在Safari中浏览您的网站时,他们点击指向当前网页所在域中URL的通用链接,iOS会尊重用户最有可能的意图并在Safari中打开该链接。
2.Copy and paste your universal link( http(s)://www.abc.com/getapp
) to notes and tap on it. 2.将您的通用链接( http(s)://www.abc.com/getapp
)复制并粘贴到笔记上,然后点击它。 It your app can handle this link you will get the option Open in "AppName"
. 如果您的应用程序可以处理此链接,您将获得“ Open in "AppName"
选项。
References- 引用-
Hope it may help. 希望对您有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.