Redirecting them isn't really a great
idea. You end up frustrating more people than it's worth. The
better option is a banner that displays at the top of the page.
Here's how I've done it in the past for clients:
<body>
<div id="my-app-banner">yada yada yada</div>
</body>
css:
#my-app-banner {
display:none;
position:absolute;
top:0;
left:0;
width:100%;
(whatever else you want)
}
.show-app-banner {
padding-top: {same height as your banner}
}
.show-app-banner #my-app-banner {
display:block;
}
Javascript:
if (navigator.userAgent.match(/Android|iPhone|iPad|iPod/i)) {
$('body').addClass('show-app-banner');
}
Depending on your theme you will have to play with the css. Best
thing about this approach is you can easily do it in a module or
the theme and even exclude pages by path. And since this is
targetting smartphones with support for modern CSS, you can really
design something nice in pure CSS (gradients, shadows, border
radius, etc.), plus use CSS3 transitions to animate things.
Also adding a close button is considered very friendly.
Jamie Holly
http://hollyit.net
On 3/11/2014 7:09 PM, Néstor wrote: