Analytics: Create a generic API in AppDelegate class

And move all Google Analytics code to AppDelegate.m
This commit is contained in:
manuroe
2017-12-22 13:19:40 +01:00
parent 062ed97457
commit e1b5675485
26 changed files with 96 additions and 199 deletions
@@ -105,15 +105,10 @@
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
// Screen tracking (via Google Analytics)
id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
if (tracker)
{
[tracker set:kGAIScreenName value:@"FilesGlobalSearch"];
[tracker send:[[GAIDictionaryBuilder createScreenView] build]];
}
// Screen tracking
[[AppDelegate theDelegate] trackScreen:@"FilesGlobalSearch"];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshSearchResult:) name:kMXSessionDidLeaveRoomNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshSearchResult:) name:kMXSessionNewRoomNotification object:nil];
}