-1

my site is responsive, and it's looking good on Safari on iPhone. But when I browse to my website from my Twitter app on my iPhone, it seems to ignore most of my mobile styling and looks very bad. Is there something I can do to detect if the browser is some kind of mobile app (such as Twitter) and cause the page to load in the default mobile browser instead (Safari, Browser, etc.)?

Edit: I strictly used CSS' max-width media query and targeted HTML5 block elements to change widths into percents. On two navs, I changed the display attribute as necessary.

Turns out it was a caching issue. It loads fine in the Twitter app. Oddly, it didn't before, even after several tries.

Mike Meldrem
  • 499
  • 1
  • 4
  • 12
  • how did you make the site responsive? what are your tests to check if the client is mobile? – talkol Feb 06 '13 at 13:30

2 Answers2

0

You can't force the user to open the link from a browser from your website. Android WebView is restricted and by default does not allow javascript and other extensions.

You can find more information here: Android WebView VS Phone Browser

Community
  • 1
  • 1
muhoweb
  • 116
  • 3
0

To the best of my knowledge, you can't force the site to open in the default mobile browser. The decision whether to open your site in the app's UIWebView or the default Safari browser is made by the Twitter app alone. If the Twitter app was gracious enough to provides any interface for you to choose, it might be possible, but they probably don't. Most app publishers try to keep users inside the app for as long as possible, and throwing them outside to a different app usually goes against this.

Your best bet is probably to try to improve your site's responsiveness to also work inside the Twitter app UIWebView as well (or inside other apps for that matter). If you base your responsiveness on screen width for example (CSS max-width and friends), I assume it should also work inside the Twitter app UIWebView.

The problem you are describing is indeed a very serious and annoying one. UIWebViews inside apps don't implement by default all of Apple's special handlers (that work inside the original Safari). The app maker is expected to implement these manually, and 99% of all apps simply don't do this. It's true for many other apps as well, the Google native search app also opens URLs inside a UIWebView - and sites tend to look lousy there too.

You should also consider filing a bug with Twitter and urge them to improve website compatibility when opened inside their app.

talkol
  • 12,564
  • 11
  • 54
  • 64
  • Well, thank you for the reply. As it turns out, it looks like it was a caching issue. I just tried again, and it looks fine in the Twitter app. – Mike Meldrem Feb 06 '13 at 14:20