@anonymous-piwik-user opened this Issue on February 14th 2013

When a visitor comes from inside an iOS App (when a page is loaded into a UIWebView), Piwik detects the Browser as Safari, but the Version is detected wrong.

iOS 5.x: Safari 5.0 (should be 5.1)
iOS 6.x: Safari 5.1 (should be 6.0)

Safari and UIWebView give mostly the same User Agent, but UIWebView is missing Version/* and Safari/*.

I think this is the reason that

iOS 5.0
UIWebView: Mozilla/5.0 (iPhone Simulator; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9A334
Safari:    Mozilla/5.0 (iPhone Simulator; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3

iOS 5.1
UIWebView: Mozilla/5.0 (iPhone Simulator; CPU iPhone OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Mobile/9B176
Safari:    Mozilla/5.0 (iPhone Simulator; CPU iPhone OS 5_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9B176 Safari/7534.48.3

iOS 6.0
UIWebView: Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10A403
Safari:    Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A403 Safari/8536.25

iOS 6.1
UIWebView: Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10B141
Safari:    Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B141 Safari/8536.25
@anonymous-piwik-user commented on February 14th 2013

I will try to fix this and submit a pull request on github.

@mattab commented on February 14th 2013 Owner

THanks for providing a fix. Also please update unit tests UserSettingsTest

@robocoder commented on February 17th 2013 Contributor

In 688f171742ed9a28c44c5a6f0a4b735230a55285: fix #3753 - fix UserAgent detection for UIWebView

@anonymous-piwik-user commented on February 20th 2013

In 961b558cd699c333fe2bfd3e612fa5437ef3c26e: fix #3753 - fix UserAgent detection for UIWebView

This Issue was closed on February 20th 2013
Powered by GitHub Issue Mirror