michalchudziak / react-native-geolocation

Geolocation APIs for React Native
MIT License
1.32k stars 233 forks source link

Location fetching on wifi connected device and not working on Mobile data enable #326

Open SKHRAPP opened 2 months ago

SKHRAPP commented 2 months ago

this is my code please help to work both mobile and wifi mode

import Geolocation from '@react-native-community/geolocation';

export const locationBackgroundCapture = () =>
  new Promise((resolve, reject) => {
    Geolocation.getCurrentPosition(
      position => {
        const currentLongitude = JSON.stringify(position.coords.longitude);
        const currentLatitude = JSON.stringify(position.coords.latitude);
        let data = {
          latitude: currentLatitude,
          longitude: currentLongitude,
        };
        resolve(data);
      },
      error => {
        reject(error);
      },
      {
        accuracy: {
          android: 'high',
          ios: 'best',
        },
        enableHighAccuracy: true,
        maximumAge: 10000,
        timeout: 50000,
      },
    );
  });

React Native Version - 0.72.4 plugin version - 3.2.1

justb commented 2 months ago

+1

rodrigocardoso-rc commented 2 months ago

+1

ViniciusCanaan commented 2 months ago

+1

sabash-dartexon commented 1 month ago

+1

SKHRAPP commented 1 week ago

+1 any update from this issue