Google Analytics: enable MXSession GA stats and send stat on launch screen display time.

This commit is contained in:
manuroe 2017-01-16 17:26:53 +01:00
parent deb866ee1c
commit febdbdb86d
2 changed files with 14 additions and 1 deletions

View file

@ -1351,6 +1351,9 @@ NSString *const kAppDelegateNetworkStatusDidChangeNotification = @"kAppDelegateN
// Disable identicon use
[MXSDKOptions sharedInstance].disableIdenticonUseForUserAvatar = YES;
// Enable SDK stats upload to GA
[MXSDKOptions sharedInstance].enableGoogleAnalytics = YES;
// Disable long press on event in bubble cells
[MXKRoomBubbleTableViewCell disableLongPressGestureOnEvent:YES];

View file

@ -828,7 +828,17 @@
}
else if (launchAnimationContainerView)
{
NSLog(@"[HomeViewController] LaunchAnimation was shown for %.3fms", [[NSDate date] timeIntervalSinceDate:launchAnimationStart] * 1000);
NSTimeInterval durationMs = [[NSDate date] timeIntervalSinceDate:launchAnimationStart] * 1000;
NSLog(@"[HomeViewController] LaunchAnimation was shown for %.3fms", durationMs);
if ([MXSDKOptions sharedInstance].enableGoogleAnalytics)
{
id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
[tracker send:[[GAIDictionaryBuilder createTimingWithCategory:kMXGoogleAnalyticsStartupCategory
interval:@((int)durationMs)
name:kMXGoogleAnalyticsStartupLaunchScreen
label:nil] build]];
}
[launchAnimationContainerView removeFromSuperview];
launchAnimationContainerView = nil;