0
votes

I have a web site that I have built in MVC 4 that has both Web and Mobile views. I am using the .Mobile extension on my views to render the mobile views when someone visits the site from a Mobile phone and that's working great. When I visit the site from an iPhone it detects the browser and displays the mobile views correctly.

However, if I add the app to the home screen and I navigate to the site by clicking on the Home Screen icon, MVC uses the standard web views.

I can only assume that when Safari is used in standalone/fullscreen mode it sends through different headers, which MVC does not recognise. (Side note: It also seems to ignore auto-login cookies that were previously set when the site was accessed normally through the browser).

What do I need to do in order to get MVC to recognise that it's still a mobile browser and render the Mobile views?

1

1 Answers

0
votes

the simple if not particularly elegant way of getting this to work is to output the useragent string when launched from the home screen icon ... and then manually overriding to make sure that that useragent or some part thereof loads mobile like this question shows how to do :

ASP.NET MVC 4 Mobile Features