Skip to content

Commit

Permalink
Merge pull request #131 from wordpress-mobile/feature/add-clear-queue…
Browse files Browse the repository at this point in the history
…d-events-to-wpanalytics

WPAnalytics: add clearQueuedEvents method
  • Loading branch information
jklausa authored May 15, 2018
2 parents e2c991c + 864f31b commit eb742da
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions WordPressShared/Core/Analytics/WPAnalytics.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ extern NSString *const WPAnalyticsStatEditorPublishedPostPropertyVideo;
+ (void)track:(WPAnalyticsStat)stat;
+ (void)track:(WPAnalyticsStat)stat withProperties:(NSDictionary *)properties;
+ (void)endSession;
+ (void)clearQueuedEvents;

@end

Expand All @@ -411,5 +412,6 @@ extern NSString *const WPAnalyticsStatEditorPublishedPostPropertyVideo;
- (void)refreshMetadata;
- (void)beginTimerForStat:(WPAnalyticsStat)stat;
- (void)endTimerForStat:(WPAnalyticsStat)stat withProperties:(NSDictionary *)properties;
- (void)clearQueuedEvents;

@end
9 changes: 9 additions & 0 deletions WordPressShared/Core/Analytics/WPAnalytics.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,13 @@ + (void)refreshMetadata
}
}

+ (void)clearQueuedEvents
{
for (id<WPAnalyticsTracker>tracker in [self trackers]) {
if ([tracker respondsToSelector:@selector(clearQueuedEvents)]) {
[tracker clearQueuedEvents];
}
}
}

@end

0 comments on commit eb742da

Please sign in to comment.