App Store 网站如何知道 iTunes 是否已安装?
作为一名用户,我真的很喜欢浏览器上的 Apple App Store 网站可以判断我是否安装了 iTunes,并可以采取相应的行动。
例如,如果我转到“记住牛奶”之类的应用程序页面: http://itunes.apple.com/app/remember- the-milk/id293561396?mt=8 然后单击“在 iTunes 中查看”按钮,
- 如果我安装了 iTunes,它将在 iTunes 中启动链接。
- 如果我没有 iTunes,我会被重定向到一个页面,让我知道我需要下载/安装首先是iTunes。
我正在尝试用我们的产品做一些非常相似的事情。 我们已经研究过使用 url 协议,例如 应用程序名称://要打开的网址 如果用户已经安装了该程序并且已向其注册了 url 协议,则此方法非常有效。
但是,如果他们不这样做,那么他们会收到一条错误消息,该消息不会告诉他们具体需要什么。
我希望获得更多 iTunes 体验,以便以更丰富的信息方式帮助我们的用户。
As a user, I really love how the Apple App Store website on a browser can tell if I have iTunes installed or not and can act accordingly.
For example, if I go to an App's page like "Remember the Milk":
http://itunes.apple.com/app/remember-the-milk/id293561396?mt=8
and then click on the "View in iTunes" button,
- If I have iTunes installed, it will launch the link in iTunes
- If I don't have iTunes, I get redirected to a page that let's me know that I need to download/install iTunes first.
I am trying to do something very similar with a product of ours.
We've investigated using url procols like
app_name://url_to_open
and this works really well if the user already has the program installed and the url protocol is registered to it.
However, if they don't, then they get an error message that doesn't tell them what specifically they need.
I'd like to have more of the iTunes experience where I can help point our users in a more informative manner.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
查看链接到该页面的 Javascript 资源,有一个名为“DetectItunesDetected”的函数。它似乎是:
如果该函数返回 true,它将用 ITMS 变体替换相关的 HTTP 链接。
Looking at the Javascript resources linked to the page, there is a function called "DetectItunesDetected". It seems to:
If the function returns true, it replaces the relevant HTTP links with ITMS variants.
该网站不知道,它使用 itms 协议。
要创建您自己的应用程序,您需要将应用程序注册到操作系统并告知它将处理哪个协议。
一篇关于此的好文章。 Windows 解释适用于所有浏览器(使用寄存器)。其他的仅适用于 Firefox。
The web site doesn't know, it uses itms protocol.
To create your own you'll need to register your application to the Operating System and tell which protocol it will handle.
A good article on that. The windows explanation works with all browsers (which use the register). Others are for firefox only.
我现在无法测试这一点,但您可以尝试使用其协议从应用程序加载图像,如果无法加载图像,请重定向。
I'm not able to test this right this moment, but you could try to load an image from your application using its protocol, if the image can't be loaded, redirect.