Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void example()
- {
- YMMMutableUserProfile *profile = [[YMMMutableUserProfile alloc] init];
- id<YMMCustomCounterAttribute> timeLeftAttribute = [YMMProfileAttribute customCounter:@"time_left"];
- [profile apply:[timeLeftAttribute withDelta:4.42]];
- [profile applyFromArray:@[
- [[YMMProfileAttribute customString:@"name"] withValue:@"Jack"],
- [[YMMProfileAttribute customString:@"born_in"] withValueIfUndefined:@"Moscow"],
- [[YMMProfileAttribute customString:@"address"] withValueReset],
- [[YMMProfileAttribute customNumber:@"age"] withValue:24],
- [[YMMProfileAttribute customNumber:@"birth_year"] withValueIfUndefined:1991],
- [[YMMProfileAttribute customNumber:@"height"] withValueReset],
- [[YMMProfileAttribute customCounter:@"logins_count"] withDelta:1],
- [[YMMProfileAttribute customBool:@"has_premium"] withValue:YES],
- [timeLeftAttribute withDelta:-8.23],
- [[YMMProfileAttribute name] withValue:@"Jack Smith"],
- [[YMMProfileAttribute gender] withValue:YMMGenderTypeMale],
- [[YMMProfileAttribute birthDate] withAge:23],
- [[YMMProfileAttribute notificationsEnabled] withValue:NO],
- ]];
- [YMMYandexMetrica setUserProfileID:@"jack23"];
- [YMMYandexMetrica reportUserProfile:[profile copy] onFailure:^(NSError *error) {
- NSLog(@"Error: %@", error);
- }];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement