0

I have an android app on Google Play and also an website where.

For the moment, I am using javascript to detect if the device connected to the website is an android device. If is, I am displaying a popup dialog on the device inviting the user to download the app from the PlayStore. If the user clicks ok, he will be redirected to the PlayStore page of my app, I f he clicks no, he will continue using the browser.

Now, the problem is that when the user have installed the app and tryes to access the webpage again, he will be asked again to download the app, even if he allready installed it (which is not a good idea).

Do you know a solution on how to check if the user has allready the app installed on his mobile device?

It is also possible to do android detection with php, so if you have a method with php to detect if the app is installed, I can also use it.

Thank you very much.

2 Answers 2

2

I don't think this is possible for security reasons. I would not want some random website I visit to be able to access my phone Package Manager and find out what apps I have installed.

This would raise a lot of privacy and security concerns.

But I saw one answer that might have a different way of achieving your intent that might be useful to you:

https://stackoverflow.com/a/12901352/1369222

Sign up to request clarification or add additional context in comments.

4 Comments

Thank you @Anup, Te answer to my question seeés logical, but the different way you proposed is not interesting in my case because if the user tryes to access the website with his browser, he will be automaticaly redirected to google play, which is not my goal.
Oh okay. Well I guess you can't do this then. Let me know if you figure out some other way though.
Yes, of corse, If I find the way, I will let you know. Thank you.
the SylvainL response seems to be apropriate. If using cookies, we could know on the website that the user tryed to access this page so we don't need to check again if he will download the app. It is not a perfect solution but can work in more than 80% of cases.
1

Even if the user doesn't install your application, your web site shouldn't ask more than one or two times to download your application from the PlayStore. The usual way of doing this is to use the browser's cookies in order to remember if it's a new visitor or not. It's not full proof because the cookies functionality could have been deactivated but at least, you won't have to worry about this problem for most of your visitors.

1 Comment

thank you very much, this is a nice idea. Do you have an example of how to use this? One think is comming on my mind, a cookie will expire in a couple of minutes, hours... How to do this in this case? Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.