Website to Desktop App – Coming Soon!

Join the waitlist now and get an exclusive early-bird discount when we launch!

+91

By filling this form you are granting the permission to share your details with Webtonative

Customizing User Agent

Customizing User Agent

The User Agent string identifies the client software generating an HTTP request, such as a web browser or app. By default, WebToNative (W2N) apps append specific strings to the end of the device's default user agent. However, you can customize these strings to include your identifiers or branding.


Default User Agent Strings:

  • iOS App: The device's default user agent is appended with "w2n/iOS".
  • Android App: The default device user agent is appended with "w2n/android".

Custom User Agent:

1. Select Custom Option: In your app settings, choose the Custom option to specify a custom user agent.

2. Provide Custom User Agent: Enter your custom user agent string. This string will replace the default identifier appended to the user agent.


Usage and Recognition:

  • The user agent, including any customizations is sent in the headers of each HTTP request originating from the app.
  • Recognition of requests from your app can be achieved by checking if the user agent contains specific identifiers like "w2n".

Accessing User Agent via JavaScript:

  • Utilize JavaScript to access the user agent directly using "navigator.userAgent".

JavaScript Filter Logic Example:

if (navigator.userAgent.indexOf('w2n') > -1) {
  // Perform actions specific to your app
}