Custom User Agent
By default, a string is appended to the end of the device user agent so that you can identify requests originating from your app versus a standard mobile browser. You may choose to customize the string that is appended or provide a complete custom user agent to be used as a replacement instead of the device default user agent. Note that for apps initially created on GoNative.io the default string that is appended includes "gonative" while newer apps include "median".
By default, the following strings are appended to the end of the device user agent:
In the iOS app, the device default user agent is appended with MedianIOS/1.0 median
In the Android app, the default device user agent is appended with MedianAndroid/1.0 median
GoNative → Median Transition
For apps that were initially created on GoNative.io the default useragent is
iOS app:
GoNativeIOS/1.0 gonative
Android app:GoNativeAndroid/1.0 gonative
For certainty check the Website Overrides tab and also view https://median.dev/device-info/ within your app.
You may specify your own custom user agent by selecting the Custom option and then providing your custom user agent.
The user agent is sent in the headers of each HTTP request coming from the app. You can then recognize the request is coming from the app by checking if it contains median
. This is useful if you want to serve different CSS, JS, or other resource files only in your apps, but not your regular website.
You may also access the user agent directly via javascript with navigator.userAgent
. To filter logic in javascript, you might use:
if (navigator.userAgent.indexOf('median') > -1) {
// do something
}
Updated about 2 months ago