How to force update Location reading?

Hello, when we do a Location reading on Android I noticed the data is not getting refreshed unless the person moves around.

Is there a way for force update to get a new Location reading?

The issue we are faced with is not just reading the latitude and longitude but we are checking the IsFromMockPropider property.

The initial reading we get is good. But if the person disables this option on the phone the property is not changing because the Location reading is stale.

Does anyone know how to do a force refresh on the data?

Thanks.

Bumping thread. I have same issue.

Are you using both Unity Input.location (for location) and native android location (for checking if update came from mockProvider)? If so, I think using just native location could solve this issue, but I am not sure.

If you found a solution, please let us know : )

Maybe You can use this code :

IEnumerator Start()
    {
        // First, check if user has location service enabled
        if (!Input.location.isEnabledByUser)
            yield break;

        // Start service before querying location
        Input.location.Start();

        // Wait until service initializes
        int maxWait = 20;
        while (Input.location.status == LocationServiceStatus.Initializing && maxWait > 0)
        {
            yield return new WaitForSeconds(1);
            maxWait--;
        }

        // Service didn't initialize in 20 seconds
        if (maxWait < 1)
        {
            print("Timed out");
            yield break;
        }

        // Connection has failed
        if (Input.location.status == LocationServiceStatus.Failed)
        {
            print("Unable to determine device location");
            yield break;
        }
        else
        {
            // Access granted and location value could be retrieved

        }
    }
private void Update(){
 if (!Input.location.isEnabledByUser)
 return; 

if (Input.location.status == LocationServiceStatus.Failed)
return;

            print("Location: " + Input.location.lastData.latitude + " " + Input.location.lastData.longitude + " " + Input.location.lastData.altitude + " " + Input.location.lastData.horizontalAccuracy + " " + Input.location.lastData.timestamp);
}