Highlighted

Tracking events in a for loop

If I do something like this: for (int i = 0; i < 10; i++) { [Tealium trackCallType:TealiumEventCall customData&colon;@{@"someNumber" : @(i)} object:nil]; } Only the first event gets tracked.
1 REPLY 1
Highlighted

Tracking events in a for loop

Employee Emeritus
Recommended solution until next library version: for (int i = 0; i < 10; i++) { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(i * NSEC_PER_SEC * 0.3)), dispatch_get_main_queue(), ^{ [Tealium trackCallType:TealiumEventCall customData&colon;@{@"someNumber" : @(i)} object:nil]; }); } Answer also available in library repo: issues section