To identify users, set values based on the Ad Rules dashboard configuration in your app, these values can be set/modified/removed at any time (even before initialisation) and will be used when attempting to load any ad type.
Supported data types: NSString, NSInteger, BOOL
Pass in a key (String) and the value to use.
[Tapdaq.sharedSession.properties setUserDataBool:YES forKey:@"paying_user"];
[Tapdaq.sharedSession.properties setUserDataString:@"A" forKey:@"group"];
[Tapdaq.sharedSession.properties setUserDataInteger:21 forKey:@"age"];
Pass in the key, the key/value will be removed if it exists.
[Tapdaq.sharedSession.properties removeUserDataForKey:@"group"];
Data can be fetched by key or returned in a map with key(NSString), value(id). When fetching by key the return value will be an object, check its type before use. There are also methods to get values of the specific type.
TDProperties *properties = Tapdaq.sharedSession.properties;
id object = [properties userDataObjectForKey:@"group"];
NSString *group = [properties userDataStringForKey:@"group"];
NSInteger age = [properties userDataIntegerForKey:@"age"];
BOOL isPayingUser = [properties userDataBooleanForKey:@"paying_user"];
NSDictionary *userData = properties.userData;
Note: If integer or boolean user data is fetched using -userDataObjectForKey: the value will be returned as NSNumber.
If you are having any problems integrating, feel free to contact us on [email protected] and we will be more than happy to help.