javascript - How to check if user has an app installed? - Stack Overflow

I have requirement to detect whether user has installed a specific app, either iOS or Android. Is there

I have requirement to detect whether user has installed a specific app, either iOS or Android. Is there a web API to detect whether user has installed a specific app? This concerns only mobile devices.

I have requirement to detect whether user has installed a specific app, either iOS or Android. Is there a web API to detect whether user has installed a specific app? This concerns only mobile devices.

Share Improve this question asked Nov 11, 2013 at 15:58 GajusGajus 74.2k80 gold badges297 silver badges473 bronze badges
Add a ment  | 

5 Answers 5

Reset to default 1

Is there a web API to detect whether user has installed a specific app?

On Android, fortunately, no, for blindingly obvious privacy and security reasons.

Hopefully, the answer is the same for iOS and any other mobile OS.

Does the app have a known scheme associated with it?

If so, you can do something like this. It's ugly, but I think that's all you can do.

Try Android Lost (Download from Google Play)

Then Login to the Web API and you can Check weather a app is installed

Even native apps can't get the list of installed apps on iOS, maybe you can give this a try but it won't do good to a proper App Store app. I haven't tried it yet but the idea seems fair enough to me.

You should use PackageManager of Android somehow in order to get the list on Android. AFAIK making use of PackageManager with a Web API is not possible.

Here are the steps that maybe worth you trial

First there must be a scheme for the app

on webpage load, add a iframe to open the scheme.(or android's intent string). At the same time, setTimeout(0.2 second) for the things you wanna do if app is no installed.

===== here is the how it works:

  1. if the app is installed, then it reacts to the scheme, and open itself. And the browser is not active, so it pauses there, and block the setTimeout

  2. if the app is not installed, then after 0.2s, the function you desire will be triggered.

notice that some little problems may occur, but I think it is acceptable

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745340732a4623314.html

相关推荐

  • javascript - How to check if user has an app installed? - Stack Overflow

    I have requirement to detect whether user has installed a specific app, either iOS or Android. Is there

    3小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信