admin管理员组

文章数量:1415684

I need to check if app is installed on iPhone or android device, using javascript code only. As i am working on html website.

I have used

window.location="appname://";

but it makes me to open an app.

Thanks in advance.

I need to check if app is installed on iPhone or android device, using javascript code only. As i am working on html website.

I have used

window.location="appname://";

but it makes me to open an app.

Thanks in advance.

Share Improve this question edited Jun 23, 2016 at 12:30 Bhavin Ramani 3,2175 gold badges32 silver badges43 bronze badges asked Jun 23, 2016 at 12:16 user3369120user3369120 892 silver badges13 bronze badges 5
  • 7 Hopefully, this is not possible, for obvious privacy reasons. – CommonsWare Commented Jun 23, 2016 at 12:18
  • 1 I hope that there is no way, cause I don't want any website know which apps I am using. – Vladyslav Matviienko Commented Jun 23, 2016 at 12:18
  • Is "appname" your own app? – AD7six Commented Jun 23, 2016 at 12:19
  • if you open quora. on your mobile device browser. It shows bottom badge to open an app if installed or not then goes to app store. – user3369120 Commented Jun 23, 2016 at 12:23
  • there is some website which provide this functionality for ex. yelp. , naukri. etc @CommonsWare – user3369120 Commented Jun 23, 2016 at 12:28
Add a ment  | 

1 Answer 1

Reset to default 3

As stated in the ments there are security and privacy reasons surrounding why you are not able to do what you are asking.

However, @CommonsWare, has already given a workaround to this problem, in a similar question, that has already been asked:

Fortunately, this is not possible, for obvious privacy reasons.

The closest that you can do is in the application, have an activity that has an for some URL structure, and have a link in the mobile Web site to a matching URL.

If the user clicks the link and the app is installed, the activity will be a chooser option for the user.

If the user clicks the link and the app is not installed, or they choose to stick with their Web browser from the chooser, whatever Web page exists at that URL will be displayed (E.g., instructions of how to download the app).

本文标签: javascriptCheck if app is existing on deviceStack Overflow