5

There are app on my app store and play store, the android, and ios version I want to generate a single link which redirects the user to app store if it opened in iPhone and redirect to play store if it open in android phone is there a way do this, there is some company doing this.

akhilesh0707
  • 6,709
  • 5
  • 44
  • 51
Shoaib Anwar
  • 819
  • 2
  • 12
  • 29

4 Answers4

5

You should specify, whether you want to achieve this on your website? If yes, you could put up JQuery to detect the device type and based on type of device you can redirect the user to desired URL (play store or app store)

<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>

<script>
        $(document).ready(function (){
         if(navigator.userAgent.toLowerCase().indexOf("android") > -1){
             window.location.href = 'https://play.google.com/store/apps/developer?id=WhatsApp+Inc.&hl=en';
         }
         if(navigator.userAgent.toLowerCase().indexOf("iphone") > -1){
             window.location.href = 'https://itunes.apple.com/in/app/whatsapp-messenger/id310633997?mt=8';
         }
        });
</script>

For more help, Refer: https://forum.webflow.com/t/redirect-to-app-store-or-play-store-if-webflow-website-opened-from-an-iphone-or-an-android-device/21350/6

Mohnish Hirudkar
  • 303
  • 3
  • 14
0

You just can do it with your server side. No service for this problem

0

You can upload (to public host) a small html page which on load will detect which device is being used and redirect accordingly. Here is an example of how to do that with JavaScript

inspector_60
  • 448
  • 1
  • 3
  • 12
  • 1
    basically i was struggling to send the short link on mobile site, now its working i have created using onelink.to. working as i desire – Shoaib Anwar Jul 20 '17 at 07:40
0

To Achieve the mentioned solution for your website, you have to take care of the following -

  1. On Desktop/Laptop browsers, You can't have one link to redirect on App Store and Play Store both. Because by Desktop OS Windows/Mac/Linux you won't be able to know about the User's Mobile Operating system.
  2. For Mobile Browsers, You can detect easily detect the device type of User based on your front-end technology(JQuery, Angular etc.). For getting the help for code you can provide the details about your front end and I am sure that community will help you on that as well.
Abhishek
  • 3,304
  • 4
  • 30
  • 44