LiveLocationSharingViewerService: Handle user location updates and stop sharing.

This commit is contained in:
SBiOSoftWhare
2022-05-03 15:54:37 +02:00
parent 2911854730
commit 9e9f734a21
3 changed files with 78 additions and 9 deletions
@@ -21,11 +21,13 @@ import CoreLocation
@available(iOS 14.0, *)
class MockLiveLocationSharingViewerService: LiveLocationSharingViewerServiceProtocol {
// MARK: Properties
private(set) var usersLiveLocation: [UserLiveLocation] = []
func isCurrentUserId(_ userId: String) -> Bool {
return "@alice:matrix.org" == userId
}
var didUpdateUsersLiveLocation: (([UserLiveLocation]) -> Void)?
// MARK: Setup
init(generateRandomUsers: Bool = false) {
@@ -46,6 +48,26 @@ class MockLiveLocationSharingViewerService: LiveLocationSharingViewerServiceProt
self.usersLiveLocation = usersLiveLocation
}
// MARK: Public
func isCurrentUserId(_ userId: String) -> Bool {
return "@alice:matrix.org" == userId
}
func startListenningLiveLocationUpdates() {
}
func stopListenningLiveLocationUpdates() {
}
func stopUserLiveLocationSharing(completion: @escaping (Result<Void, Error>) -> Void) {
}
// MARK: Private
private func createFirstUserLiveLocation() -> UserLiveLocation {
let userAvatarData = AvatarInput(mxContentUri: nil, matrixItemId: "@alice:matrix.org", displayName: "Alice")
let userCoordinate = CLLocationCoordinate2D(latitude: 51.4932641, longitude: -0.257096)