I am writing a browser for iOS (iPad) and I was wondering how I could make a user setting that will make the browser seem as if it was Safari Desktop, Firefox, etc. (I am a beginner) Thank you!
Asked
Active
Viewed 261 times
1 Answers
0
NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys:@"custom user agent", @"UserAgent", nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:dictionary];
[dictionary release];
before you create your web view may work.

Joshua Nozzi
- 60,946
- 14
- 140
- 135

Stefan
- 1,496
- 1
- 13
- 26
-
I just tried this but nothing happened. For the User Agent I did `Mozilla/5.0 (iPad; U; CPU OS 4_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8F190 Safari/6533.18.5` It still acts as though the browser is Safari for iPhone. Please help. Thank you – Jared Zoneraich Aug 14 '11 at 16:58
-
I think it's important that you run that code before you create a web view. So if you load the web view from a nib it might be too late. YOu could try the approach in this post instead: http://blog.hawkey.org/?p=347 – Stefan Aug 15 '11 at 10:43