- Home /
WWW in iOS does not set user agent header
I use WWW class to send event statistic. But it seem like it not sent user agent header (which I want to collect) in iOS
Is it true that it not sent?
Is it a bug? Would it be fixed?
If I need to use HashTable, how can I get user agent string from system or construct it programmatically? I don't want to switch case by my own
Thanks for your answer
I'm not sure what you need, but seems like you need to improve your "google fu". There are lots of related questions there, one of which is most likely sure to be your question and thus this must be a duped question. Here are few of them: http://answers.unity3d.com/questions/468412/webclient-headers-not-showing-in-ios-build.html , http://answers.unity3d.com/questions/303702/wwwresponseheaders-or-wwwerror-are-not-working-on.html and even "outside" http://stackoverflow.com/questions/18704334/xcode-cant-find-header-files-in-unity3d-project
Answer by Bunny83 · Apr 14, 2014 at 03:22 PM
The user agent header (rfc2616) is only ment for the client software (the user agent, in your case the Unity player) to identify itself. There is no "valid standard" which tells what the header field has to contain. Most browsers include, beside their product name, things like their html renderer, operating system / hardware, ... but that's by no means a requirement since the header is even optional.
There is no "User Agent" header for the system since, again, it describes the client software. If you need this header to distinguish between iOS / Android / standalone... you have to setup your own.
Here's a list of common User Agent headers just to get a glimpse of how many different agent-strings are out there.
In android there are always useragent sent from WWW class of unity
And even in ios native there are also UIWebView class which can tell useragent too
Only when we use unity in ios there are no useragent sent from WWW
Useragent can tell the operating system, os version, device model and so on. It is important for collect analytics or separate platform serving content
Your answer
Follow this Question
Related Questions
WWW error on ios 1 Answer
Unity modules for iOS? 1 Answer
iPhone Controller Asset 0 Answers
iOS: Handheld.PlayFullScreenMovie 2 Answers