With your knowledge of mobile and blocks etc I was wondering if there is a way of showing/hiding blocks based on wether a site is being viewed on an iphone as a web app rather than simply in native mobile safari.
Clients are interested in having an APP and it seems to be usually a key set of features of their website e.g. a leisure centres timetables. I am therefore trying to limit the menu options when in the web app but dont want to limit it in mobile safari
I came across the code below and wondered if it could be adapted to be used in the php section of the block setup

if (window.navigator.userAgent.indexOf('iPhone') != -1) {
    if (window.navigator.standalone == true) {
        alert("Yes iPhone! Yes Full Screen!");
    } else {
        alert("Not Full Screen!");
    };} else {
        alert("Not iPhone!");
        document.location.href = 'please-open-from-an-iphone.html';
};

I feel this goes to the heart of the issue of "if you have a really responsive website that works well on a smartphone - why would you have an app/web app" my feeling is it is to give a more targeted response. currently if leisure centre users > open safari > go to the website > use the nav bar to find time tables and from the (superfish) dropdorn choose say NLC group exercise. The top of their screen is taken up with URL bar, header containing company logo branding etc, lots of menu items then the timetable. This COULD be what they want if they then want to browse the website BUT if they choose the 'Timetable web app' when they click on this it is full screen, no url bar, no logo (they know who the timetable is from) and just the timetable. and the menu bar simply has
Centres | Timetables | book online
the issue is that clicking on centres pages (if in the timetables web app) needs to keep this minimalist menu and not the standard menu

It is a larger question "if you do a really good job of a responsive website then unless the web app helps by decluttering and focussing on a particular feature like the one above why have a web app at all except to hide the url bar

Comments

Jeff Burnz’s picture

Personally I won't get involved in the politics of the question, clients want all sorts of things regardless of how good or bad it is, so I will avoid that thorn bush.

Technically using a detection script like browsecap or mobile detect - don't know is the short answer. However if that JS is working for you now to hide the controls then why not use it to remove the blocks?