Add AnalyticsScreenTimer and track more screens.

Update Analytics with new methods in MXAnalyticsDelegate.
This commit is contained in:
Doug
2021-12-02 14:25:45 +00:00
parent 418865a388
commit 315f5a9cc4
42 changed files with 513 additions and 42 deletions
+10 -7
View File
@@ -134,8 +134,6 @@
NSNotificationName const RoomCallTileTappedNotification = @"RoomCallTileTappedNotification";
NSNotificationName const RoomGroupCallTileTappedNotification = @"RoomGroupCallTileTappedNotification";
NSString * const RoomAnalyticsNotificationsCategory = @"notifications";
NSString * const RoomAnalyticsNotificationsTimeToDisplayContent = @"timelineDisplay";
const NSTimeInterval kResizeComposerAnimationDuration = .05;
@interface RoomViewController () <UISearchBarDelegate, UIGestureRecognizerDelegate, UIScrollViewAccessibilityDelegate, RoomTitleViewTapGestureDelegate, RoomParticipantsViewControllerDelegate, MXKRoomMemberDetailsViewControllerDelegate, ContactsTableViewControllerDelegate, MXServerNoticesDelegate, RoomContextualMenuViewControllerDelegate,
@@ -258,6 +256,8 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
@property (nonatomic, strong) UserSuggestionCoordinatorBridge *userSuggestionCoordinator;
@property (nonatomic, weak) IBOutlet UIView *userSuggestionContainerView;
@property (nonatomic) AnalyticsScreenTimer *screenTimer;
@end
@implementation RoomViewController
@@ -340,6 +340,8 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
_voiceMessageController = [[VoiceMessageController alloc] initWithThemeService:ThemeService.shared mediaServiceProvider:VoiceMessageMediaServiceProvider.sharedProvider];
self.voiceMessageController.delegate = self;
self.screenTimer = [[AnalyticsScreenTimer alloc] initWithScreen:AnalyticsScreenRoom];
}
- (void)viewDidLoad
@@ -569,9 +571,6 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
{
[super viewWillAppear:animated];
// Screen tracking
[Analytics.shared trackScreen:AnalyticsScreenRoom];
// Refresh the room title view
[self refreshRoomTitle];
@@ -612,8 +611,7 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
[self.roomDataSource reload];
[LegacyAppDelegate theDelegate].lastNavigatedRoomIdFromPush = nil;
notificationTaskProfile = [MXSDKOptions.sharedInstance.profiler startMeasuringTaskWithName:RoomAnalyticsNotificationsTimeToDisplayContent
category:RoomAnalyticsNotificationsCategory];
notificationTaskProfile = [MXSDKOptions.sharedInstance.profiler startMeasuringTaskWithName:MXTaskProfileNameNotificationsOpenEvent];
}
}
@@ -709,6 +707,9 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
hasJitsiCall = NO;
[self reloadBubblesTable:YES];
}
// Screen tracking
[self.screenTimer start];
}
- (void)viewDidDisappear:(BOOL)animated
@@ -744,6 +745,8 @@ const NSTimeInterval kResizeComposerAnimationDuration = .05;
hasJitsiCall = YES;
[self reloadBubblesTable:YES];
}
[self.screenTimer stop];
}
- (void)viewDidLayoutSubviews