Add polls analytics (#1691)

* Refactor location events

* Add poll analytics
This commit is contained in:
Alfonso Grillo
2023-09-13 09:28:44 +02:00
committed by GitHub
parent dc5514bc0b
commit f3618cda9d
10 changed files with 105 additions and 54 deletions
@@ -806,6 +806,8 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
private func sendPollResponse(pollStartID: String, optionID: String) {
Task {
let sendPollResponseResult = await roomProxy.sendPollResponse(pollStartID: pollStartID, answers: [optionID])
analytics.trackPollVote()
switch sendPollResponseResult {
case .success:
break
@@ -819,6 +821,7 @@ class RoomScreenViewModel: RoomScreenViewModelType, RoomScreenViewModelProtocol
Task {
let endPollResult = await roomProxy.endPoll(pollStartID: pollStartID,
text: "The poll with event id: \(pollStartID) has ended")
analytics.trackPollEnd()
switch endPollResult {
case .success:
break