Reputation: 2069
I need to emulate iOS 7.0.4 behavior on my Safari desktop by changing the user agent string. The options in Safari are only available for iOS 4.3.3 as shown below
Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5
Is it possible to modify this to iOS7 behavior?
Upvotes: 0
Views: 1776
Reputation: 112857
Use a HTTP proxy / HTTP monitor like Charles Proxy (free trial) to see exactly what is being sent. In my case it is:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.73.11 (KHTML, like Gecko) Version/7.0.1 Safari/537.73.11
As should be obvious this will change with each version of Safari.
The user agent string can be set in the NSMutableURLRequest
by setting the header field for the key: @"User-Agent".
[mutableURLRequest setValue:@"SPECIAL USER AGENT STRING" forHTTPHeaderField:@"User-Agent"];
Upvotes: 2