A way to detect whether or not to install a client in the Android and iOS browsers _android

Source: Internet
Author: User

We hope that more users will use our products and hope to retain more users. It's important to make the user use the client at this point.

After all, the client is actually occupied the user's desktop, every day more or less will see our products.
Then, as a mobile phone web products, users through the mobile browser to visit our page, we hope that users can directly use or download our client products.
Finally there is a download banner said.

Ios

When it comes to iOS, it's exciting to start with IOS6, and we just need to add META tags to the HTML.
The specific META tags are: <meta name= "Apple-itunes-app" content= "app-id=504274740"/>
Of course, for a more specific description, see the Apple Developer Platform documentation: promoting Apps with Smart App banners
What about the IOS6 below?
My answer is: Directly show a download banner bar.

Android

For Android, if we're careful, we'll find that a lot of apps will be running in the background. I can't shut it off.
In this way, we can make a request to the background process, and then judge whether or not we have installed our app by determining whether the request responds correctly.
If the response is not correct, we think it should be not installed on our client application.
The basic idea is this, we see Code implementation:

Copy Code code as follows:
(function () {
var isInstalled,
url = ' _url_ ',//Find the Android engineer.
Script = document.createelement (' script ');

script.src = URL;
Script.onload = function () {
Alert (' is installed. ');
IsInstalled = true;
};
Script.onerror = function () {
Alert (' May is not installed. ');
isInstalled = false;
}

Document.body.appendChild (script);
})();

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.