react-native-geolocation icon indicating copy to clipboard operation
react-native-geolocation copied to clipboard

watchposition() issues

Open SKHRAPP opened this issue 1 year ago • 4 comments

timeout is not workling properly why ?

code

 let watchId;
 watchId = Geolocation.watchPosition(handleSuccess, handleError, {
        timeout: 1000,
        enableHighAccuracy: true,
        interval: 15 * 60 * 1000,
        maximumAge: 3000,
      });


  const handleError = error => {
        console.log(error, 'error dataaa');
        Geolocation.clearWatch(watchId);
      };

  const handleSuccess = async position => {
        let data = {
          latitude: parseFloat(position.coords.latitude).toFixed(6),
          longitude: parseFloat(position.coords.longitude).toFixed(6),
        };
        console.log(data, 'dataaaa');
     Geolocation.clearWatch(watchId);
      };

SKHRAPP avatar Oct 24 '24 09:10 SKHRAPP