1 Reply Latest reply on May 8, 2018 12:01 PM by Joydeep Chakraborty

    Adding a string into the User Agent for Android 6+

    Betsy Gamrat

      Following Enterprise Browser 1.8 - Config.xml UserAgent for Android 6+ running on a new TC75x, I used this user agent as a starting point:

      KitKat and higher

      <UserAgent value="Mozilla/5.0 (Linux; Android %%AndroidVersion%%; %%DeviceModel%% Build/%%BuildNumber%%) AppleWebKit/%w (KHTML, like Gecko) Version/%e Chrome/%c Mobile Safari/%w MAC=%%MAC%% ESN=%%ESN%%" />

       

      I am adding the word Scanner into the user agent to allow the server to vary the pages, since our application runs across scanners, other mobile devices and desktops.

       

      This is the user agent string I set in Config.xml

       

      <UserAgent  value="Mozilla/5.0 (Linux; Android %%AndroidVersion%%; %%DeviceModel%% Build/%%BuildNumber%%) AppleWebKit/%w (KHTML, like Gecko) Version/%e Chrome/%c Mobile Safari/%w MAC=%%MAC%% ESN=%%ESN%% Scanner" />

       

      The user agent received by the server is:

       

      "Mozilla/5.0 (Linux; Android 6.0.1; TC75x Build/01-16-06.2-MG-00; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 Mobile Safari/537.36 MAC=REDACTED ESN=REDACTED Scanner MAC=REDACTED ESN=REDACTED Scanner"

       

      This didn't happen on the Windows devices.

       

      What is the proper way to add text into the user agent string?