I tested my code to detect fake locations in two ways:
-
Receiving location updates from
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation])
. This code returnslocation?.sourceInformation?.isSimulatedBySoftware
as true (which is correct for my scenario) -
Getting
CLLocationManager().location
directly. This code returnslocation?.sourceInformation?.isSimulatedBySoftware
as false (which is incorrect)
Why CLLocationManager().location
returns the correct location infos but not return correct isSimulatedBySoftware info?