@@ -58,14 +58,19 @@ - (void)identify:(SEGIdentifyPayload *)payload
58
58
59
59
- (void )track : (SEGTrackPayload *)payload
60
60
{
61
- [Flurry logEvent: payload.event withParameters: payload.properties];
61
+ NSMutableDictionary *properties = [self truncateProperties: payload.properties];
62
+
63
+ [Flurry logEvent: payload.event withParameters: properties];
64
+ SEGLog (@" Flurry logEvent:%@ withParameters:%@ " , payload.event , properties);
62
65
}
63
66
64
67
- (void )screen : (SEGScreenPayload *)payload
65
68
{
66
69
if ([self screenTracksEvents ]) {
67
70
NSString *event = [[NSString alloc ] initWithFormat: @" Viewed %@ Screen" , payload.name];
68
- [Flurry logEvent: event withParameters: payload.properties];
71
+ NSMutableDictionary *properties = [self truncateProperties: payload.properties];
72
+ [Flurry logEvent: event withParameters: properties];
73
+ SEGLog (@" Flurry logEvent:%@ withParameters:%@ " , event, properties);
69
74
}
70
75
71
76
// Flurry just counts the number of page views
@@ -80,4 +85,18 @@ - (BOOL)screenTracksEvents
80
85
return [(NSNumber *)[self .settings objectForKey: @" screenTracksEvents" ] boolValue ];
81
86
}
82
87
88
+ // Returns NSDictionary truncated to 10 entries
89
+
90
+ -(NSMutableDictionary *)truncateProperties : (NSDictionary *) properties
91
+ {
92
+ NSMutableDictionary *truncatedProperties;
93
+ for (NSString *property in properties) {
94
+ truncatedProperties[property] = properties[property];
95
+ if ([truncatedProperties count ] == 10 ) {
96
+ break ;
97
+ }
98
+ }
99
+ return truncatedProperties;
100
+ }
101
+
83
102
@end
0 commit comments