Custom Headers
Your app can be configured to send custom headers to your web server. You can define parameter names and values and use both constant strings as well as device variables.
Two device variables are available:
%DEVICEID%
will send the device’s unique identifier.
%DEVICENAME64%
will send the device name as a Base64 encoded UTF-8 string, e.g. "Robert's iPhone".
You may also edit appConfig.json file in your source code directly. Please add the following fields to the "general" section under Import/Export when configuring your app.
"general": {
"androidCustomHeaders": {
"x-median-example-parameter": "example_value",
"x-median-app-version": "android_app_v5",
"x-median-device-id": "%DEVICEID%",
"x-median-device-name": "%DEVICENAME64%"
},
"iosCustomHeaders": {
"x-median-example-parameter": "example_value",
"x-median-app-version": "ios_app_v5",
"x-median-device-id": "%DEVICEID%",
"x-median-device-name": "%DEVICENAME64%"
}
}
Please note that custom headers are only added to the request for the original document request. Any CSS, JS, or image resources, or any other resources requested via AJAX will not include the custom headers in order to maintain fast performance.
In order to test the custom headers, you may click "View more devices" from your app's Private Management URL, and then enable the Network Intercept option on the bottom. This will show all network traffic your app is making, and you may inspect the request headers using the tool.
Updated 12 months ago