Open
Description
At the moment the mocked
field is only set for Android implementation. For the app we're working on I created the following extesion and made a patch for the moment. This issue is so that we can add it officially to the package in LocationUtils.swift
func locationToDict(_ location: CLLocation) -> [String: Any] {
return [
"coords": [
"latitude": location.coordinate.latitude,
"longitude": location.coordinate.longitude,
"altitude": location.altitude,
"accuracy": location.horizontalAccuracy,
"altitudeAccuracy": location.verticalAccuracy,
"heading": location.course,
"speed": location.speed,
"mocked": location.isSimulated()
],
"timestamp": location.timestamp.timeIntervalSince1970 * 1000 // ms
]
}
extension CLLocation {
func isSimulated() -> Bool {
if #available(iOS 15.0, *) {
return self.sourceInformation?.isSimulatedBySoftware ?? false
} else {
return false
}
}
}
Metadata
Metadata
Assignees
Labels
No labels