iOS Keep UIWebView from entering mobile site

Wellington2k

macrumors regular
Original poster
Jun 4, 2011
131
0
Hello.

I have a UIWebView going to a certain site.

However the site I want to go to is the regular site.com not m.site.com.

Any help?

I've seen that the Skyfire app has a desktop mode, and it works fine there.
 
Last edited:

jiminaus

macrumors 65816
Dec 16, 2010
1,449
1
Sydney
In Mac OS X, I've done the opposite of this. I mimicked the iPhone user agent string but sending setCustomUserAgent: to an WebView. Unfortunately UIWebView has such a crippled API and doesn't have this.
 

Wellington2k

macrumors regular
Original poster
Jun 4, 2011
131
0
Thanks, phantax!

It worked perfectly!

+ (void)initialize {
NSDictionary *dictionnary = [[NSDictionary alloc] initWithObjectsAndKeys:mad:"Desktop", @"UserAgent", nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:dictionnary];
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.