Closed adam-zethraeus closed 5 years ago
Thanks for this! We are going to take a look at this internally and see if we'd like to pull this into the main SDK. It might take us a few weeks to get an answer because we have a few other major initiatives in flight at the moment.
Sounds good! Thanks for letting me know.
Was this considered / found to be potentially useful?
This commit uses TuneUserDefaultUtils within TuneUserAgentCollector to cache a mapping between iOS version and Safari UserAgent.
e.g.
10.3.1
->Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Mobile/14E8301
11.2
->Mozilla/5.0 (iPhone; CPU iPhone OS 11_2 like Mac OS X) AppleWebKit/604.4.7 (KHTML, like Gecko) Mobile/15C107
If this mapping exists, the user agent is then returned from it instead of instantiating a UIWebView to find it.
Risk: The user agent has to date only been updated with a corresponding iOS change, indeed the iPhone OS version is part of the user agent string. This patch assumes that it's safe to say that that won't change.