메뉴
이 내용이 도움이 되었나요?

# Preset Properties

# 1. Preset Properties of All Events

All Events in macOS SDK would have the following preset property.

# 2. Other Preset Properties

In addition to the Preset properties above, some preset properties would only be recorded after corresponding API is called:

Property name Display name Property type Instruction
#duration Event duration Numeric value Timing function timeEvent should be invoked to record the event duration (Unit: second)
#background_duration Background duration numeric value Timing function timeEvent should be called to record the background duration within an event interval (Unit: second)

# Getting Preset Properties

When some preset properties of the APP is required for Server data tracking, this method can be invoked to get the preset properties of the APP and then send them to the server

//get property objects
TDPresetProperties *presetProperties = [instance getPresetProperties];

//Preset properties of Event
NSDictionary *properties = [presetProperties toEventPresetProperties];
/*
   {
        "#os": "iOS",
        "#device_id": "A8B1C00B-A6AC-4856-8538-0FBC642C1BAD",
        "#bundle_id": "com.sw.thinkingdatademo",
        "#manufacturer": "Apple",
        "#device_model": "iPhone7",
        "#system_language": "zh",
        "#os_version": "10",
        "#network_type": "WIFI",
        "#zone_offset": 8,
        "#app_version":"1.0.0"
    }
*/

//get a certain preset properties
NSString *bundle_id = presetProperties.bundle_id; //app bundle id
NSString *os = presetProperties.os;//os type, e.g., MacOS
NSString *system_language = presetProperties.system_language; //type of mobile phone system language
NSString *os_version = presetProperties.os_version; //system version number
NSNumber *zone_offset = presetProperties.zone_offset; //timezone offset value
NSString *app_version = presetProperties.app_version; //app version number
Copy

IP, nation and city information are parsed and generated by the server. The client shall not provide the interface to get such properties

# 4. Disable preset property tracking

Under certain scenarios, you may want to forbid tracking certain preset properties to ensure compliance and meet actual business requirements. Add TDDisPresetProperties field of array type in the info.plist, Add the prefab properties that need to be masked to this field. e.g., "#fps", @"#ram", @"#disk", @"#start_reason", @"#simulator", the configuration is as follows: