Location always instantly returns with a timeout
See original GitHub issueLocation request timed out
this is the error I get whenever I’m trying to access the user’s location.
Here’s my code:
import Exponent from 'exponent';
export async function getPosition() {
const {Location, Permissions} = Exponent;
const {status} = await Permissions.askAsync(Permissions.LOCATION);
if (status === 'granted') {
return Location.getCurrentPositionAsync({enableHighAccuracy: true});
} else {
throw new Error('Location permission not granted');
}
}
some component
componentDidMount() {
getPosition().then((position) => {
if (position) {
console.log(position);
}
}).catch((e) => {
// this one is firing the error instantly
alert(e + ' Please make sure your location (GPS) is turned on.');
});
}
Android 6.0.1
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
Android GPS timeout - Stack Overflow
I need a feature to 'get the GPS location and send it to the server, unless it takes more than one minute'. My...
Read more >Geolocation.getCurrentPosition() - Web APIs | MDN
The Geolocation.getCurrentPosition() method is used to get the current position of the device.
Read more >How to Fix the 504 Gateway Timeout Error on Your Site - Kinsta
Learn how to fix the 504 Gateway Timeout error code on your WordPress site. Simple, easy to follow solutions to bring your site...
Read more >Request location updates - Android Developers
Appropriate use of location information can be beneficial to users of your app. For example, if your app helps the user find their...
Read more >Troubleshoot Lambda function retry and timeout issues when ...
Average time that a full API request takes (until it's successfully returned); If retries should be made by the AWS SDK or code....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok we figured out how to reproduce this. Will fix it in the next release.
I think that’s the same error @alexprice91. We’re doing a release this week and we’ll see if that fixes these issues.