Zeeba
Zeeba

Reputation: 1122

Detecting Mobile traffic on website

Ok here we go I will try to make this as clear as I can.

I have made a website that can be view very clearly with any phone, tablet and, computer; I am about to have an app. What I have been looking for with no luck whatsoever is how can I prompt mobile devices about my app? I was hoping to maybe have a window come up saying we have an app get it now button or a continue on button which leads to our full site, trouble I am having is every mobile detection script I have found only detects so far as I can tell and I can't seem to get it to send the mobile users one way and the computers another (scripts were php) another was jquery but when I viewed the site with the mobile browser is was all crazy looking because I had to get the jquery to work as a redirect.

Next issue is I have not the slightest idea how to or were to send a user for the app. a perfect example of what I want to do is at http://www.bankofamerica.com but I want to continue button to go to the full site.

Hope this was not to long winded.

Upvotes: 0

Views: 403

Answers (1)

Zeeba
Zeeba

Reputation: 1122

ok for anyone who want to know this is the best option I can find and by far the least annoying to users.

download: https://code.google.com/p/php-mobile-detect/

and write this in your page or however you wish to do it. I use a mix of my own and bootstrap styling on my webpages for the classes.

<?php if($detect->isIOS()) : ?>

<div class="alert alert-block alert-success" id="mobileApp" style="position:absolute; left:10px; top:15px; z-index:1003; width:910px; text-align:center;"> <button type="button" class="close" data-dismiss="alert">Close</button> <div class="span3"><img src="imgs/if.png" width="125" height="125"></div> <div class="span5"><h3>we are on the go!</h3></div>

<div class="row"> <div class="span4"><h4>Download our app TODAY!</h4> <a href="#" class="btn btn-success btn-large " style="color:#fff;">Download iPhone App </a> </div>

</div> </div>

<?php endif; ?>

you can repeat this for the android with

<?php if($detect->isAndroidOS()) : ?>

Upvotes: 1

Related Questions