Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook in iPad: UIWebView - renders as touch instead of standard web

Up until a few days ago it worked fine: opening facebook.com in iPad/UIWebView rendered as standard web. Now Facebook is force-rendered as touch - as if the URL was http://touch.facebook.com. This happens regardless of the UIWebView frame size. Here is a simple code for the main view controller to see the problem:

UIWebView *wv = [[UIWebView alloc] initWithFrame:self.view.frame];
NSURLRequest *req = [NSURLRequest requestWithURL:[NSURL  URLWithString:@"http://www.facebook.com"]];
[wv loadRequest: req];
[self.view addSubview: wv];

I tried changing the user agent as suggested here - no good.

like image 513
Tal Yaniv Avatar asked Jul 31 '10 07:07

Tal Yaniv


1 Answers

Using http://www.facebook.com?m2w should resolve this. "m2w" sounds like it is short for "mobile 2 web", and it's the link that you arrive at when you click "full site" from the mobile site.

like image 142
Ryan Patterson Avatar answered Nov 09 '22 11:11

Ryan Patterson