Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UserAgent detection inside iOS App (UIWebView) gives the wrong version number #3753

Closed
anonymous-matomo-user opened this issue Feb 14, 2013 · 4 comments
Assignees
Labels
Bug For errors / faults / flaws.
Milestone

Comments

@anonymous-matomo-user
Copy link

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-matomo-user
Copy link
Author

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

@mattab
Copy link
Member

mattab commented Feb 14, 2013

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

@robocoder
Copy link
Contributor

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

@anonymous-matomo-user
Copy link
Author

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

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws.
Projects
None yet
Development

No branches or pull requests

3 participants