Skip to main content

Preset properties

Last updated 08/27/2026

1. Preset properties​

The preset properties collected on the iOS and Android platforms differ to some extent. For details, see the following documents:

iOS preset properties, Android preset properties

2. Get preset properties​

In v2.0.1 and later, you can call the getPresetProperties() method to get preset properties.

When server-side tracking needs some preset properties from the app, you can use this method to get them on the app side and then pass them to the server.

//Get the property object
TDPresetProperties presetProperties = await TDAnalytics.getPresetProperties();

//Generate event preset properties
Map<String, dynamic>? eventPresetProperties = presetProperties.toEventPresetProperties();
/*
{
"#carrier": "中国电信",
"#os": "iOS",
"#device_id": "A8B1C00B-A6AC-4856-8538-0FBC642C1BAD",
"#screen_height": 2264,
"#bundle_id": "com.sw.thinkingdatademo",
"#manufacturer": "Apple",
"#device_model": "iPhone7",
"#screen_width": 1080,
"#system_language": "zh",
"#os_version": "10",
"#network_type": "WIFI",
"#zone_offset": 8
}
*/

//Get a specific preset property
String bundleId = presetProperties.bundleId;//Package name
String os = presetProperties.os;//OS type, such as Android and iOS
String systemLanguage = presetProperties.systemLanguage;//Phone system language
int screenWidth = presetProperties.screenWidth;//Screen width
int screenHeight = presetProperties.screenHeight;//Screen height
String deviceModel = presetProperties.deviceModel;//Device model
String deviceId = presetProperties.deviceId;//Unique device identifier
String carrier = presetProperties.carrier;//Carrier of the phone's SIM card; on dual-SIM phones, the carrier of the primary SIM card is used
String manufacture = presetProperties.manufacturer;//Phone manufacturer, such as HuaWei and Apple
String networkType = presetProperties.networkType;//Network type
String osVersion = presetProperties.osVersion;//OS version
double zoneOffset = presetProperties.zoneOffset;//Time zone offset

IP address, country, and city information is parsed and generated on the server side. The client doesn't provide APIs to get these properties

Was this page helpful?