The privacy policy of apps that integrate the TDBehavior module should be updated based on our Privacy Agreement with the following additional information:
(1) Function Description: To identify machine behavior fraud risks, the SDK needs to obtain relevant behavior information from you or your end users.
(2) Necessary Personal Information: Touch, scroll, swipe, screen edge swipe, scale behavior information; input behavior information (input type, number of times, input speed, input time); application foreground/background behavior information; browsing page names and dwell time behavior information; device orientation behavior information; gyroscope sensor behavior information; accelerometer sensor behavior information; mouse behavior information (web); keyboard behavior information (web)
(3) Other Optional Personal Information: None
pod 'TrustDecisionBehavior', '1.5.0' in the corresponding target in the Podfilepod install --repo-update command in the folder where the Podfile is located. (M1 series mac computers need to execute arch -x86_64 pod install --repo-update command)Behavior collect methods are used to obtain user behavior data. The interface definition is as follows:
typedef struct _TDBehaviorResultStruct{
// Return code, 0 represents success
const NSInteger code;
// Behavior collect data
char* const payload;
// Error message when failed
char* const msg;
}TDBehaviorResultStruct;
/*** TDBehavior start, start behavior collect, write collected data into SDK internal container
*/
void (*start)(void);
/*** TDBehavior stop, end behavior collect, stop writing collected data into SDK internal container and clear the data in SDK internal container;
*/
void (*stop)(void);
/*** TDBehavior collect, return behavior collect result, if data exists in SDK internal container, it will return success code == 0, and clear the data in SDK internal container;
* If no data exists in SDK internal container, it will return code == 104 error code
*/
TDBehaviorResultStruct (*collect)(void);Sample Code
⚠️⚠️⚠️ Ensure that there is user behavior after calling start in the business interface, such as text input, click, swipe, etc. Otherwise, calling collect will return a 104 error code, indicating that no behavior data was collected;
Specify input fields that do not require collected
Set the attribute accessibilityIdentifier including "TDBehaviorExInput" in UITextField、UITextView . After this setting, the text input events of UITextField、UITextView will no longer be collected
// will not collect UITextField text input
UITextField *textField = [[UITextField alloc]init];
textField.accessibilityIdentifier = @"otherKey,TDBehaviorExInput";
// will not collect UITextView text input
UITextView *textView = [[UITextView alloc]init];
textView.accessibilityIdentifier = @"otherKey,TDBehaviorExInput"; TDMobRiskManager_t *manager = [TDMobRiskManager sharedManager];
// When entering business interface, call start method to perform behavior collect, for example when entering login interface
manager->start();
...
// When calling business interface, call collect method to get behavior collect data, for example when clicking login button
TDBehaviorResultStruct resultStruct = manager->collect();
NSInteger code = resultStruct.code;
char* msg = resultStruct.msg;
char* payload = resultStruct.payload;
if (code == 0){
NSLog(@"Get behavior collect result successfully, payload:%s",payload);
}else{
NSLog(@"Get behavior collect result failed, code:%ld,msg:%s",code,msg);
}
...
// When leaving business interface, call stop method to end behavior collect, for example when leaving login interface
manager->stop();