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?.isSimulatedBySoftwareas true (which is correct for my scenario) -
Getting
CLLocationManager().locationdirectly. This code returnslocation?.sourceInformation?.isSimulatedBySoftwareas false (which is incorrect)
Why CLLocationManager().location returns the correct location infos but not return correct isSimulatedBySoftware info?