Performing enableLocationRequest always hangs forever on iOS 12.X
crowmagnumb opened this issue · 5 comments
Which platform(s) does your issue occur on?
iOS devices and emulators running 12.X
iPad Pro: iOS 12.2
iPhone 7: iOS 12.3.1
emulator iPhone Xs: iOS 12.1
I do not experience the problem on an iPhone 5s: iOS 9.3.2
Please, provide the following version numbers that your issue occurs with:
- CLI: 5.0.3
- Cross-platform modules: tns-core-modules: 5.1.2
- Runtime(s): tns-android: 5.0.0, tns-ios: 5.0.0
- Plugin(s): nativescript-geolocation: 5.0.0
Please, tell us how to recreate the issue in as much detail as possible.
Simply put the following code never resolves on iOS 12.X. The promise is neither resolved nor rejected.
import * as geolocation from "nativescript-geolocation";
...
geolocation.enableLocationRequest(true, true)
.then(() => {
console.log("User Enabled Location Service");
})
.catch(ex => {
console.log("Unable to Enable Location", ex);
});
Hi @crowmagnumb,
We recently released {N} 6.0, plugin demo apps are updated and enableLocationRequest works as expected on iOS 12. Could you try updating to the latest version (or at least 5.4 if you are not ready to switch to the new bundle workflow) and check whether the issue happens on your side?
I would really appreciate some help. i'm new to {n} and I'm running into this same issue. I have a bare bones Angular app. all it is trying to do is to get my location, but enableLocationRequest
never resolved. It doesn't hit the then or the catch. I'm on mac using simulator iOS 12.4.
"nativescript-angular": "~8.2.0",
"nativescript-geolocation": "^5.1.0",
"nativescript-theme-core": "~1.0.4",
"tns-core-modules": "~6.0.0",
"nativescript-dev-webpack": "~1.0.0",
Are there any known issues or workarounds for getting this to work? Any help would be greatly appreciated!
Hi @crowmagnumb, @dbfannin,
When you use enableLocationRequest with always option set to true, you need to add NSLocationAlwaysAndWhenInUseUsageDescription key in your app's Info.plist. You could refer to the method's description in the README.
We just updated all demo apps to use enableLocationRequest(true, true) with both options enabled.