iOS Universal Link App Store重定向 [英] iOS Universal Link App Store redirect

查看:1065
本文介绍了iOS Universal Link App Store重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有通用链接正常工作,安装应用程序后我看到链接如何打开应用程序,未安装时打开Safari中的网址。



实际上我想要做的是重定向并转到应用程序商店,这样用户就可以直接下载应用程序。
我将在html文件中包含重定向,因为我知道通用链接不支持重定向http服务器配置级别(无论如何我认为这仅适用于清单文件,apple-apps-site-association )



任何人都可以确认这是否是正确的方法,或唯一的方法吗?我不喜欢先打开safari的想法,加载我的html(只有重定向),然后去商店。看起来没有更简单的方法。

解决方案

你是对的:不允许服务器端重定向 apple-app-site-association 文件。但是,我相信一旦用户打开通用链接并(假设应用程序安装)登陆URL,所有选项都在桌面上(服务器端或其他方式)。



如果您的Universal Links URL另一端的页面包含即时JS重定向到您应用的App Store页面,那应该可以正常工作。这样的事情:

  window.location ='itms-apps://itunes.apple.com/us/app/imdb -movies-tv / id342792525'

但是,不管你怎么做,Safari还在继续打开。它会快速闪过,用户可能甚至都不会注意到。这是我刚刚对


I have universal links working correctly, when the app is installed I see how the link opens the app, and when it's not installed opens the url in safari.

Actually what I would like to do is to redirect and go to the app store, so users can download the app directly. Im going to include a redirect on the html file, because I know universal links don't support redirects a the http server config level (anyway I think this is for the manifest file only, apple-apps-site-association)

Anyone can confirm if this is the right way to do it, or the only way to do it? I don't like the idea to open safari first, load my html (with the redirect only) and then go to the store. Looks like there's no easier way to do it.

解决方案

You're right: server-side redirects aren't allowed for the apple-app-site-association file. However, I believe once the user opens a Universal Link and (assuming the app is not installed) lands on the URL, all options are on the table (server-side, or otherwise).

If the page on the other end of your Universal Links URL contains an instant JS redirection to your app's App Store page, that should work just fine. Something like this:

window.location = 'itms-apps://itunes.apple.com/us/app/imdb-movies-tv/id342792525'

But yes, no matter how you do it, Safari is still going to open. It'll flash past so quickly that the user likely won't even notice. Here's a real-time recording I just made of the Branch.io deep linking service's demo app doing exactly this process:

这篇关于iOS Universal Link App Store重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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