Titanium JIRA Archive
Appcelerator Community (AC)

[AC-6596] Any option to enable GPS automatically

GitHub Issuen/a
TypeNew Feature
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAppcelerator Modules, Titanium SDK & CLI
Labelsn/a
ReporterPraveen Kumar
AssigneeAbir Mukherjee
Created2020-08-29T14:57:39.000+0000
Updated2020-09-03T11:20:00.000+0000

Description

Hello, I am facing issue in some devices only is related to getting user current location. In these devices Ti.Geolocation.locationServicesEnabled is value is false. So we have to manually enable the 'GPS' service.Have any option to automatically enabling the 'GPS'. Like Android LocationRequest manager.

Attachments

FileDateSize
location.jpeg2020-08-29T14:53:33.000+000059898

Comments

  1. Praveen Kumar 2020-08-31

    Any updates!
  2. Hans Knöchel 2020-09-01

    I assume you mean iOS? No, that is not possible (even natively) due to system privacy restrictions. But if it is disabled, you can show an alert to open the system settings and then link them to the settings using:
       var settingsURL = Ti.App.iOS.applicationOpenSettingsURL;
       if (Ti.Platform.canOpenURL(settingsURL)) {
           Ti.Platform.openURL(settingsURL);
       }
       
    See the [docs](http://docs.appcelerator.com/platform/latest/#!/api/Titanium.App.iOS-property-applicationOpenSettingsURL) for details.
  3. Praveen Kumar 2020-09-03

    No. it's in android. Facing the issue in some devices ( HTC - android 9 OS ) only. In my code, i ensure that Ti.Geolocation.hasLocationPermissions/Ti.Geolocation.requestLocationPermissions after that Ti.Geolocation.locationServicesEnabled return false. So we need to manualy enable GPS service. So looking functionalities of LocationSettingsRequest.Builder in android native

JSON Source