mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-29 04:36:58 +02:00
Add trigger to join and view room metrics events #5769
- Added trigger for JoinedRoom event - Tracking ViewRoom event for rooms and events
This commit is contained in:
@@ -213,9 +213,11 @@ final class AppCoordinator: NSObject, AppCoordinatorType {
|
||||
case .homeSpace:
|
||||
MXLog.verbose("Switch to home space")
|
||||
self.navigateToSpace(with: nil)
|
||||
Analytics.shared.activeSpace = nil
|
||||
case .space(let spaceId):
|
||||
MXLog.verbose("Switch to space with id: \(spaceId)")
|
||||
self.navigateToSpace(with: spaceId)
|
||||
Analytics.shared.activeSpace = userSessionsService.mainUserSession?.matrixSession.spaceService.getSpace(withId: spaceId)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1104,6 +1104,19 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
|
||||
shouldNavigateToRoomWithId:(NSString *)roomId
|
||||
threadId:(NSString *)threadId
|
||||
{
|
||||
if (roomId)
|
||||
{
|
||||
MXRoom *room = [self.mxSessions.firstObject roomWithRoomId:roomId];
|
||||
if (room.summary.membership != MXMembershipJoin)
|
||||
{
|
||||
Analytics.shared.joinedRoomTrigger = AnalyticsJoinedRoomTriggerNotification;
|
||||
}
|
||||
else
|
||||
{
|
||||
Analytics.shared.viewRoomTrigger = AnalyticsViewRoomTriggerNotification;
|
||||
}
|
||||
}
|
||||
|
||||
_lastNavigatedRoomIdFromPush = roomId;
|
||||
[self navigateToRoomById:roomId threadId:threadId];
|
||||
}
|
||||
@@ -2941,6 +2954,11 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
|
||||
{
|
||||
MXRoom *room = [mxSession roomWithRoomId:roomId];
|
||||
|
||||
if (room && room.summary.membership == MXMembershipJoin)
|
||||
{
|
||||
[Analytics.shared trackViewRoom:room];
|
||||
}
|
||||
|
||||
// Indicates that spaces are not supported
|
||||
if (room.summary.roomType == MXRoomTypeSpace)
|
||||
{
|
||||
@@ -3172,6 +3190,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
|
||||
[mxSession createRoomWithParameters:roomCreationParameters success:^(MXRoom *room) {
|
||||
|
||||
// Open created room
|
||||
Analytics.shared.viewRoomTrigger = AnalyticsViewRoomTriggerCreated;
|
||||
[self showRoom:room.roomId andEventId:nil withMatrixSession:mxSession];
|
||||
|
||||
if (completion)
|
||||
@@ -3206,6 +3225,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
|
||||
if (directRoom)
|
||||
{
|
||||
// open it
|
||||
Analytics.shared.viewRoomTrigger = AnalyticsViewRoomTriggerCreated;
|
||||
[self showRoom:directRoom.roomId andEventId:nil withMatrixSession:mxSession];
|
||||
|
||||
if (completion)
|
||||
|
||||
Reference in New Issue
Block a user