最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Open native app store from a single link? - Stack Overflow

programmeradmin4浏览0评论

I am creating an app using PhoneGap for Android, iPhone and Windows Phone. I have to send a mon URL in phone by SMS, so is it possible to open the native app store in the phone through a mon link?

Like if someone have iPhone then after clicking on that link the app store will show that app to download.

I am creating an app using PhoneGap for Android, iPhone and Windows Phone. I have to send a mon URL in phone by SMS, so is it possible to open the native app store in the phone through a mon link?

Like if someone have iPhone then after clicking on that link the app store will show that app to download.

Share Improve this question edited Aug 10, 2016 at 8:23 Phonolog 6,5313 gold badges39 silver badges65 bronze badges asked Aug 9, 2016 at 21:37 Tusshar KumarTusshar Kumar 511 silver badge2 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 4

You could detect which OS the client is using and then proceed to load the correspondent URL. As Govind Singh Nagarkoti suggests in this post ( redirect to appstore or google play ) you could do something like this:

<script>
     $(document).ready(function (){
         if(navigator.userAgent.toLowerCase().indexOf("android") > -1){
             window.location.href = 'http://play.google./store/apps/details?id=PACKAGEURL';
     }
         if(navigator.userAgent.toLowerCase().indexOf("iphone") > -1){
             window.location.href = 'http://itunes.apple./lb/app/PACKAGEURL';
     }
    });
</script>
发布评论

评论列表(0)

  1. 暂无评论