使用 javascript 或 url 在 iPhone 上检测已安装的应用程序 [英] Detecting installed apps on iPhone with javascript or url

查看:57
本文介绍了使用 javascript 或 url 在 iPhone 上检测已安装的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为 iPhone 构建一个基于 HTML5 的移动网络应用程序.我需要检查用户是否有我建议的特定应用程序.我听说每个 iPhone 应用程序都有唯一的 URL 方案来检测它们的应用程序身份.

I am building a HTML5 based mobile web app for iPhone. I need to check whether user has specific application that I suggest. I heard that each iPhone application has unique URL scheme to detect their app indentity.

因此,我阅读了这篇文章以获得一个想法.

Therefore, I've read this article to get an idea.

是否可以为 YouTube 和地图等 iPhone 应用注册基于 http+域的 URL Scheme?

然而,这并不是我想要制作的完美答案.

However, this is not perfect answer to make what I am trying to make.

这是可能发生的事情

  1. 用户在移动网络浏览器上点击推荐应用.
  2. 检查应用程序 iTunes URL 和 URL 方案.
  3. 如果用户已经安装了应用程序,则返回已安装"==> 在这种情况下,屏幕返回到移动浏览器.

  1. User clicks a recommendation app on mobile web browser.
  2. Check with application iTunes URL and URL scheme.
  3. If the user has the installed application, it returns 'installed' ==> In this case, the screen returns back to mobile browser.

如果用户没有安装的应用程序,则返回'uninstalled'==> 在这种情况下,屏幕移动到 App Store.

If the user does not have the installed application, it returns 'uninstalled' ==> In this case, the screen moves to App Store.

我正在使用 PHP 语言运行移动网络应用.

I am running mobile web app with PHP language.

谢谢.

推荐答案

这恐怕是不可能的.老实说,我很高兴,因为如果任何旧网页可以检测到我安装了哪些应用程序,就会存在真正的隐私问题.

this is not possible I'm afraid. To be honest I'm glad, as there are real privacy concerns if any old web page can detect which apps I have installed.

这绝对不是一件好事!

更新:如果你很高兴成为原生的,这个库会做你想做的.. http://www.cocoacontrols.com/platforms/ios/controls/ihasapp

UPDATE: If you're happy to go native, this library will do what you want.. http://www.cocoacontrols.com/platforms/ios/controls/ihasapp

这篇关于使用 javascript 或 url 在 iPhone 上检测已安装的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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