This repository was archived by the owner on Nov 8, 2023. It is now read-only.
This repository was archived by the owner on Nov 8, 2023. It is now read-only.
Android geolocation.getCurrentLocation gives error when no internet connection?? #108
Closed
Description
Make sure to check the demo app(s) for sample usage
I have, not come across anything similar
Make sure to check the existing issues in this repository
I have, not come across anything similar
If the demo apps cannot help and there is no issue for your problem, tell us about it
Location throws error when no internet connection??
Which platform(s) does your issue occur on?
- Platform: Android 7.0 Nougat
- Device: Huawei p8 Lite 2017 PRA-LX1
Please, provide the following version numbers that your issue occurs with:
"nativescript": {
"id": "testapp",
"tns-ios": {
"version": "3.4.1"
},
"tns-android": {
"version": "3.4.1"
}
},
"dependencies": {
"@angular/animations": "~5.1.0",
"@angular/common": "~5.1.0",
"@angular/compiler": "~5.1.0",
"@angular/core": "~5.1.0",
"@angular/forms": "~5.1.0",
"@angular/http": "~5.1.0",
"@angular/platform-browser": "~5.1.0",
"@angular/platform-browser-dynamic": "~5.1.0",
"@angular/router": "~5.1.0",
"nativescript-angular": "~5.1.0",
"nativescript-fontawesome": "^1.0.0",
"nativescript-geolocation": "^4.2.3",
"nativescript-google-maps-sdk": "^2.4.3",
"nativescript-localstorage": "^1.1.5",
"nativescript-permissions": "^1.2.3",
"nativescript-pro-ui": "^3.3.0",
"nativescript-screen-orientation": "^2.0.0",
"nativescript-theme-core": "~1.0.4",
"nativescript-vibrate": "^2.0.1",
"reflect-metadata": "~0.1.8",
"rxjs": "~5.5.2",
"tns-core-modules": "~3.4.0",
"zone.js": "~0.8.18"
},
"devDependencies": {
"babel-traverse": "6.4.5",
"babel-types": "6.4.5",
"babylon": "6.4.5",
"lazy": "1.0.11",
"nativescript-dev-typescript": "~0.6.0",
"typescript": "~2.4.2"
},
Please, tell us how to recreate the issue in as much detail as possible.
I check if the platform is Android by doing if(app.android)
using import * as app from "tns-core-modules/application";
then I request location permission by doing permissions.requestPermission(android.Manifest.permission.ACCESS_FINE_LOCATION, "")
this is all fine. But then when I call geolocation.getCurrentLocation
it gives an error saying "cannot enable location services" when i put the mobile in airplane mode or disabled mobile data/wifi. I need the geolocation to work offline and it should be getting the location viw the GPS signal and NOT internet right??
Is there any code involved?
Metadata
Metadata
Assignees
Labels
No labels