# Custom User Agent

### <mark style="color:green;">What is User Agent?</mark>

A user-agent is like a digital ID card that your app carries with it when it talks to your website. It tells the website what kind of device your customers are using.&#x20;

If you want to identify that request is coming from your mobile app then you can set custom user-agent such as `twinr-app.` Now, this user-agent string will be passed to each request to your website and you can easily identify that request is coming from the mobile app.

User-Agent String is contained in https headers with other info.

A sample user-agent string for an iPhone using the Safari browser might look like this:

`Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Mobile/15E148 Safari/604.1`

This string contains several pieces of information about the device and browser:

* **"Mozilla/5.0"** is a standard prefix for user-agent strings that indicates the browser is compatible with the HTTP protocol used by the web.
* **"iPhone; CPU iPhone OS 14\_4 like Mac OS X"** indicates that the device is an iPhone running the 14.4 version of the iPhone operating system.
* **"AppleWebKit/605.1.15"** indicates that the browser is using the WebKit rendering engine, which is developed by Apple and used in Safari and other browsers.
* **"Version/14.0.3"** indicates the version of the Safari browser.
* **"Mobile/15E148"** indicates the mobile version of the browser
* **"Safari/604.1"** indicates the browser type as Safari version 604.1

### <mark style="color:green;">How to setup Custom User Agent?</mark>

<figure><img src="https://3731994945-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlBy5z08zL1UoCwNqmg%2Fuploads%2FFCRJQSQ04qEaHfGgznSo%2FScreenshot%202024-01-25%20at%209.55.14%E2%80%AFAM.png?alt=media&#x26;token=7d8d5d29-50b4-4925-a7c2-90fe45cc24ab" alt=""><figcaption></figcaption></figure>

**1.)** Go to Add-ons -> Extensions -> Custom User Agent & Enable it.

<mark style="color:red;">**NOTE:**</mark> <mark style="color:red;">Please create a new version of the App e.x. 1.0.2, if the current version does not support this feature. If the previous version is live on the stores, then request a new build and submit this new version to the stores.</mark>

**2.)** Enter the User Agent String in the field. You can define separate agents for Android and iOS.

**3.)** Enable the "Attach" option if you want to concatenate with the existing user-agent string. It will look like below.

`Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Mobile/15E148 Safari/604.1 Flow_app_agent`

**4.)** Save as a draft.

### <mark style="color:green;">When should I use Custom User Agent?</mark>

* When you want to manipulate whole app with different UI, JS for different devices.
* If you want to use social media login feature from your website then you must setup Custom User-Agent to make it working.

### <mark style="color:green;">Common Questions</mark>

<details>

<summary><strong>What kind of User-Agent string I can use?</strong></summary>

You can use any kind of string for the User-Agent. Try to avoind any special characters.

</details>
