Created
October 10, 2013 01:12
-
-
Save derryl/6911438 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// User-Agent Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.43 | |
userAgent = [ | |
NSString stringWithFormat:@"%@/%@ (%@; iOS %@; Scale/%0.2f)" | |
, [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleExecutableKey] ?: [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleIdentifierKey] | |
, (__bridge id)CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle() | |
, kCFBundleVersionKey) ?: [[[NSBundle mainBundle] infoDictionary] objectForKey:(__bridge NSString *)kCFBundleVersionKey] | |
, [[UIDevice currentDevice] model] | |
, [[UIDevice currentDevice] systemVersion] | |
, ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] ? [[UIScreen mainScreen] scale] : 1.0f) | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment