enableLocationRequest promise never gets resolved on Android
See original GitHub issueWhich platform(s) does your issue occur on?
- Android 7.1 Emulator
Please, provide the following version numbers that your issue occurs with:
- CLI: 3.3.0
- Cross-platform modules: 3.2.0
- Runtime(s): 3.2.0
- Plugin(s):
"nativescript-drop-down": "3.1.1",
"nativescript-geolocation": "4.2.0",
"nativescript-google-maps-sdk": "2.3.2",
"nativescript-ios-uuid": "1.0.0",
"nativescript-iqkeyboardmanager": "1.0.1",
"nativescript-local-notifications": "1.2.2",
"nativescript-phone": "1.3.0",
"nativescript-push-notifications": "0.1.5",
"nativescript-theme-core": "1.0.4",
"tns-core-modules": "3.2.0"
Please, tell us how to recreate the issue in as much detail as possible.
Well, simply request location permission on Android device.
Is there any code involved?
geolocation.enableLocationRequest().then( function () {
// I never get here...
});
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
Geolocation: right way to use getCurrentLocation promise ...
resolve () // Start promise chain with a resolved native Promise. .then(function() { if (!Geolocation.isEnabled()) { return Geolocation.
Read more >Promise.resolve() - JavaScript - MDN Web Docs
The Promise.resolve() method "resolves" a given value to a Promise. ... eventual fulfillment value of the promise will never be thenable.
Read more >Track The Device Geolocation In A NativeScript Angular ...
Learn how to use native geolocation features within a NativeScript Android and iOS application built with Angular to track device location.
Read more >JavaScript Promises: an introduction - web.dev
The promise constructor takes one argument, a callback with two parameters, resolve and reject. Do something within the callback, perhaps async, ...
Read more >Async and Await in JavaScript, the extension to a promise.
Here is an example with a promise that resolves in 2 seconds. This is a more elegant way of getting a promise result...
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 Free
Top 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
@DimitarTachev :
geolocation.getCurrentLocation({ timeout : 0 })
works.@DimitarTachev In your comment you mentioned using Accuracy.any could cause this behavior on devices without a mobile network? Is there a reliable way to get (at least) a coarse location on devices without network (or on airplane mode)?
I’ve been having the same issue on my app, seemingly randomly, for a while now. i.e.
Is the way to fix it
timeout: 0
or removing the timeout altogether?