[ 
https://issues.apache.org/jira/browse/CB-2520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14006467#comment-14006467
 ] 

Craig Payne commented on CB-2520:
---------------------------------

It would be extra nice if I can set a portion of the userAgent string to a 
fixed value, and optionally have Cordova tack on a bit of info about the actual 
device the code's running on (iPhone, iPad, iPod) too.

Perhaps in the project's config.xml file:

< preference name="OverriddenUserAgentString" value= "My Cool UserAgent Main 
String" />

And then have the app spit out in the user_agent portion of the Request 
something like:

"My Cool UserAgent Main String, iPhone"

For my current purposes, knowing the type of device is sufficient, but it might 
be more generally useful to know the more detailed Apple model (iPhone5, 
iPhone3GS, iPad3, etc.)

> iOS: "original" user agent needs to be overridable
> --------------------------------------------------
>
>                 Key: CB-2520
>                 URL: https://issues.apache.org/jira/browse/CB-2520
>             Project: Apache Cordova
>          Issue Type: New Feature
>          Components: iOS
>    Affects Versions: Master
>            Reporter: Kevin Hawkins
>              Labels: core
>   Original Estimate: 8h
>  Remaining Estimate: 8h
>
> Cordova's user agent management for iOS employs a scheme of setting a 
> baseline "original" user agent, which by default conforms to the standard 
> user agent a UIWebView would expose, and then optionally appending 
> CDVViewController-specific data to it in the appropriate use cases, to manage 
> whitelisting.
> Cordova shouldn't really care too much about the data that the original user 
> agent exposes.  I.e. it should be able to be overridden by a consumer, so 
> that the consumer can supply its own user agent data.  This is not 
> technically possible with the current implementation of the CDVUserAgentUtil 
> class, since it does not exist as a member of any instance class; it's truly 
> static/global, so inheritance doesn't come into play.
> Even if an instance of CDVuserAgentUtil could be made a property of 
> CDVViewController, or something else, it would be kind of weird for a 
> consumer to inherit from what's essentially a static class, just to configure 
> their own user agent data.
> There should be another mechanism for users to override the original user 
> agent configuration.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to