Can AppendUserAgent be set in code


#1

I need to include the version number of the app in the UserAgent but manually setting it in the XML to be the same as the could introduce a human error if the AppendUserAgent gets out of date with the widget.

Can AppendUserAgent be set in code so that I can ensure it contains the correct version number?


#2

Maybe you could use the app version plugin to get the correct version number?


#3

Yep. Thing is, can I set the AppendUserAgent with the value returned?


#4

Short Google search:


(iOS support seems limited to WKWebView though)


#5

Which version number do you need in the UA? If it is the one from config.xml anyway, maybe there is a way to use it in there via a variable anyway?


#6

Yep, unfortunately that plugin doesn’t support iOS 8 which I need to support. Probably a grunt task will be the best way to modify config.xml instead of code.