AppendUserAgent preference not setting


#1

config.xml
<preference name="AppendUserAgent" value="myApp"/>
<preference name="OverrideUserAgent" value="myApp"/>

They both don’t work. Whenever I check my user-agent using navigator.userAgent, I always get Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36.

I’m using a browser, though (Chrome).

Cordova CLI: 6.5.0 Ionic Framework Version: 3.1.1 Ionic CLI Version: 2.2.2 Ionic App Lib Version: 2.2.1 Ionic App Scripts Version: 1.3.7 ios-deploy version: Not installed ios-sim version: Not installed OS: Windows 10 Node Version: v7.9.0 Xcode version: Not installed

(Oh, and I’m using Ionic 3.6.1.)


#2

Nevermind. Apparently, those preferences don’t apply if you’re testing the app using a desktop browser. I built it and had it run using an actual Android device and that got it working.