Answer the question
In order to leave comments, you need to log in
How to determine the type of device from the browser?
Hello!
There is a regular html page with different rates for using one mobile application. And there, accordingly, there are call-to-action buttons, like going to the application or to one of the stores. In this regard, a few questions:
1) if this is a mobile device, how to determine from the browser whether it is android or ios, so that later you can open google play or app store, respectively? The only way I know of is the user-agent, but I read somewhere that in some browsers it gives incorrect information on purpose to protect the user. Are there any other ways?
2) the next task, if the user has this application, you need to open it by clicking on the button on the site. As I understand it, we cannot check the presence of the application from the browser due to security reasons? It remains only to launch the link in the hope that it exists and will start? Or is there something that can be done?
Answer the question
In order to leave comments, you need to log in
The most adequate option if you do not want to dance with a user agent is to give the user a choice. It won't affect anything.
If a person is sitting on an android through a browser that lies that he is a safari, then you will give him a link to the appstore. But he has an android .. How do you decide? - Right. No way.
So just give the person 2 application buttons like they do almost everywhere and don't rack their brains
user-agent.
The percentage of users who set themselves crooked user agents (sicurnast, yeah) is negligible compared to the percentage of normal people, so don't worry.
Considering the fact that the Safari browser is not cross-platform and is available only on Apple devices, as well as the fact that any browser on Apple devices is just a wrapper around Safari, I believe we can safely say that if a user with Safari comes to you, then is an Apple product user.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question