Cristopher Vieira
Cristopher Vieira

Reputation: 5

How to make a web link open directly on Google Play Store

I have a blogger website using a template, www.aplitechstore.com.br, We have added many app links to download on Google Play, but they do not open in the Google Play Store app but on the website. I want to change that, I want our app and website (in Webview mode) after clicking the link, open it in the Google Play Store app.

Upvotes: 0

Views: 7121

Answers (1)

user6144987
user6144987

Reputation:

As explained here, Google Play provides url protocol

market://details?id=<package_name>

Applying on Blogger :

Place the following javascript code at the bottom and before </body>. This will change Google Play links only on Android.

<script>
if (/(android)/i.test(navigator.userAgent)) {
  document.querySelectorAll('a[href]').forEach(function (link) {
    link.href = link.href.replace('https://play.google.com/store/apps/','market://');
  });
}
</script>

Upvotes: 1

Related Questions