Add location related analytics (#1241)

* Refactor trackComposer method

* Track location screen

* Refactor isPinDropSharing -> isSharingUserLocation

* Add trackComposer event

* Fix UTs

* Cleanup

* Add AnalyticsLocationType
This commit is contained in:
Alfonso Grillo
2023-07-05 12:54:03 +02:00
committed by GitHub
parent ce14d13962
commit d15d0e0070
12 changed files with 94 additions and 34 deletions
@@ -511,15 +511,21 @@ class RoomFlowCoordinator: FlowCoordinatorProtocol {
coordinator.actions.sink { [weak self] action in
guard let self else { return }
switch action {
case .selectedLocation(let geoURI):
case .selectedLocation(let geoURI, let isUserLocation):
Task {
_ = await self.roomProxy?.sendLocation(body: geoURI.bodyMessage,
geoURI: geoURI,
description: nil,
zoomLevel: nil,
assetType: .pin)
assetType: isUserLocation ? .sender : .pin)
self.navigationSplitCoordinator.setSheetCoordinator(nil)
}
self.analytics.trackComposer(inThread: false,
isEditing: false,
isReply: false,
locationType: isUserLocation ? .myLocation : .pin,
startsThread: nil)
case .close:
self.navigationSplitCoordinator.setSheetCoordinator(nil)
}