michalchudziak / react-native-geolocation

Geolocation APIs for React Native
MIT License
1.31k stars 228 forks source link

Default `auto` to Play Services location provider if available #267

Open jkaufman opened 1 year ago

jkaufman commented 1 year ago

This PR reflects the one-line change proposed in #266

sunil2709 commented 12 months ago

255 const getCurrentLocation = useCallback(

(timeout = 3000, ignoreError = false) => {
  if (locationPermissionStatus !== LocationPermissionStatus.GRANTED) {
    return;
  }

  Geolocation.getCurrentPosition(
    (position) => {
      console.log('position', position);
      setCurrentLocation(position);
    },
    (error) => {
      console.log('error', error);
      if (ignoreError) {
        return;
      }
      setLocationPermissionStatus(LocationPermissionStatus.SERVICE_DENIED);
    },
    {
      enableHighAccuracy: true,
      timeout,
      maximumAge: 10000,
    },
  );
},
[locationPermissionStatus],

);

sunil2709 commented 12 months ago

On the above comment given the follwing solution of the opened issue from your side, kindly update me when the isuue is closed.