;
}
-void CyteInitialize(NSString *app, NSString *version) {
+void CyteInitialize(NSString *agent) {
UIScreen *screen([UIScreen mainScreen]);
if ([screen respondsToSelector:@selector(scale)])
ScreenScale_ = [screen scale];
safari = [info objectForKey:@"CFBundleVersion"];
}
- NSString *agent([NSString stringWithFormat:@"%@/%@ CyF/%.2f", app, version, kCFCoreFoundationVersionNumber]);
+ agent = [NSString stringWithFormat:@"%@ CyF/%.2f", agent, kCFCoreFoundationVersionNumber];
- if (RegEx match = RegEx("([0-9]+(\\.[0-9]+)+).*", safari))
- agent = [NSString stringWithFormat:@"Safari/%@ %@", match[1], agent];
+ if (safari != nil)
+ if (RegEx match = RegEx("([0-9]+(\\.[0-9]+)+).*", safari))
+ agent = [NSString stringWithFormat:@"Safari/%@ %@", match[1], agent];
if (RegEx match = RegEx("([0-9]+[A-Z][0-9]+[a-z]?).*", System_))
agent = [NSString stringWithFormat:@"Mobile/%@ %@", match[1], agent];
- if (RegEx match = RegEx("([0-9]+(\\.[0-9]+)+).*", product))
- agent = [NSString stringWithFormat:@"Version/%@ %@", match[1], agent];
+ if (product != nil)
+ if (RegEx match = RegEx("([0-9]+(\\.[0-9]+)+).*", product))
+ agent = [NSString stringWithFormat:@"Version/%@ %@", match[1], agent];
[CyteWebViewController setApplicationNameForUserAgent:agent];
}