Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25558] Ti.Geolocation.locationServicesEnabled still returns false in Android.

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionDuplicate
Resolution Date2017-11-29T18:37:42.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterSuraj Datta
AssigneeUnknown
Created2017-11-23T17:01:51.000+0000
Updated2018-08-06T17:41:13.000+0000

Description

Hello All, I'm always getting false with the use of Ti.Geolocation.locationServicesEnabled on android. Tested this on Android device with os version 6 & 7. Turning Location services on or off returns same value. Steps i was performing to get location: 1) checking for location permission using hasLocationPermissions() — This works perfect 2) Check whether location service is On/Off using Ti.Geolocation.locationServicesEnabled – Returns false always. I'm using Titanium SDK: 6.3.0 Any help would be appreciated. Thanks.

Attachments

FileDateSize
index.js2017-11-24T04:59:57.000+0000573
index.xml2017-11-24T04:59:56.000+0000181

Comments

  1. Sharif AbuDarda 2017-11-23

    Hello, Send a full reproducible code for us to test. Thanks.
  2. Suraj Datta 2017-11-24

    Hi, I've added the test code. Pls. chk it once, also i've added the permissions necessary for location services in Manifest file. Thanks.
  3. Suraj Datta 2017-11-25

    Hi All, Guys any progress on this ticket? Need your help for solving this issue. Thanks.
  4. Sharif AbuDarda 2017-11-26

    Hello, Did you provide runtime permission for location service?
  5. Suraj Datta 2017-11-27

    Hello, I've used following code for getting runtime permission.
       
       if(Ti.Geolocation.hasLocationPermissions()){
       // if permission is true --> check for location toggle true/false using Ti.Geolocation.locationServicesEnabled
       }else{
       // if permission is false --> request for permission using Ti.Geolocation.requestLocationPermissions()
       Ti.Geolocation.requestLocationPermissions(Ti.Geolocation.AUTHORIZATION_ALWAYS, function(e){
       
       });
       }
       
    Thanks.
  6. Gary Mathews 2017-11-29

    Duplicate of TIMOB-23135
  7. Eric Merriman 2018-08-06

    Closing as a duplicate. If this is in error, please reopen.

JSON Source