implement the start, send and stop functions

This commit is contained in:
Mauro Romito
2026-04-02 17:18:18 +02:00
committed by Mauro
parent dc67d49d47
commit df5570281b
6 changed files with 531 additions and 0 deletions
@@ -751,6 +751,38 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
return .failure(.sdkError(error))
}
}
// MARK: - Live Location
func startLiveLocationShare(durationMillis: UInt64) async -> Result<Void, RoomProxyError> {
do {
try await room.startLiveLocationShare(durationMillis: durationMillis)
return .success(())
} catch {
MXLog.error("Failed starting live location share with error: \(error)")
return .failure(.sdkError(error))
}
}
func sendLiveLocation(geoURI: GeoURI) async -> Result<Void, RoomProxyError> {
do {
try await room.sendLiveLocation(geoUri: geoURI.string)
return .success(())
} catch {
MXLog.error("Failed sending live location with error: \(error)")
return .failure(.sdkError(error))
}
}
func stopLiveLocationShare() async -> Result<Void, RoomProxyError> {
do {
try await room.stopLiveLocationShare()
return .success(())
} catch {
MXLog.error("Failed stopping live location share with error: \(error)")
return .failure(.sdkError(error))
}
}
// MARK: - Private