We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
with this code import Geolocation from '@react-native-community/geolocation';
/**
The text was updated successfully, but these errors were encountered:
No branches or pull requests
with this code
import Geolocation from '@react-native-community/geolocation';
/**
*/
export const getCurrentLocation = async () => {
return new Promise((resolve, reject) => {
Geolocation.getCurrentPosition(
(position) => {
const { latitude, longitude } = position.coords;
resolve({ latitude, longitude });
},
(error) => {
console.error('Error fetching location:', error);
reject({ error: 'Unable to fetch location' });
},
{
enableHighAccuracy: true, // Set to true for better accuracy
timeout: 15000,
maximumAge: 10000,
},
);
});
};
The text was updated successfully, but these errors were encountered: