Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_requestLocation = () => {
this.setState({ loading: true, location: null });
GetLocation.getCurrentPosition({
enableHighAccuracy: true,
timeout: 150000,
})
.then(location => {
this.setState({
location,
loading: false,
});
})
.catch(ex => {
const { code, message } = ex;
console.warn(code, message);
if (code === 'CANCELLED') {
Alert.alert('Location cancelled by user or by another request');
}
if (code === 'UNAVAILABLE') {
onPress={() => {
GetLocation.openAppSettings();
}}
/>
onPress={() => {
GetLocation.openCelularSettings();
}}
/>
onPress={() => {
GetLocation.openGpsSettings();
}}
/>
onPress={() => {
GetLocation.openWifiSettings();
}}
/>