{ "id": "167188", "key": "TIMOB-24596", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "10000", "description": "", "name": "Done" }, "resolutiondate": "2018-12-09T05:30:38.000+0000", "created": "2017-04-19T10:19:31.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-12-09T05:30:38.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [], "description": "*Issue Description:*\r\nOn android when the device's GPS mode is set to GPS only then it fails to get the location coordinates. It occurs on android 6 using SDK 6.1.0.v20170309181051, 6.0.2GA, 6.0.1GA. On iOS it works fine.\r\n\r\n*Steps to reproduce:*\r\n1. Run the sample code in index.js file.\r\n2. When the app opens up it'll ask for location permission. If you grant location permission, the app will alert the coordinates.\r\n3. But if you go into the settings of the phone and set the GPS mode to \"GPS only\" then the app does not return the coordinates.\r\n\r\n*Expected:*\r\nApp should return the location coordinates.\r\n\r\n*Actual:*\r\nIt doesn't return the location coordinates in GPS only mode.\r\n\r\n*Test Code:*\r\n{code}\r\n$.index.open();\r\n\r\nif (!Ti.Geolocation.hasLocationPermissions(Ti.Geolocation.AUTHORIZATION_ALWAYS)) {\r\nTi.Geolocation.requestLocationPermissions(Ti.Geolocation.AUTHORIZATION_ALWAYS, function(e) {\r\n\r\n});\r\n} else {\r\ngetGps();\r\n}\r\n\r\nfunction getGps() {\r\n\r\nvar coords = {};\r\nvar method = \"\";\r\n\r\nvar providerGps = Ti.Geolocation.Android.createLocationProvider({\r\nname : Ti.Geolocation.PROVIDER_GPS,\r\nminUpdateDistance : 0.0,\r\nminUpdateTime : 0\r\n});\r\n\r\nTi.Geolocation.Android.addLocationRule(Ti.Geolocation.Android.createLocationRule({\r\nprovider : Ti.Geolocation.PROVIDER_GPS,\r\naccuracy : Alloy.CFG.accuracy,\r\nmaxAge : Alloy.CFG.maxAge,\r\nminAge : Alloy.CFG.minAge\r\n}));\r\n\r\nTi.Geolocation.Android.addLocationProvider(providerGps);\r\nTi.Geolocation.Android.manualMode = true;\r\n\r\nTitanium.Geolocation.getCurrentPosition(function(e) {\r\nif (e.error) {\r\nif ( typeof errorCallback != \"undefined\" && errorCallback != null) {\r\nalert(e.error);\r\n}\r\n} else {\r\nmethod = e.provider.name;\r\ncoords = e.coords;\r\n\r\nalert(coords);\r\n\r\n}\r\n});\r\n\r\n}\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: Unable to get the geolocation coordinates when GPS is set to GPS only mode.", "creator": { "name": "jnaher", "key": "jnaher", "displayName": "Jebun Naher", "active": false, "timeZone": "Asia/Dhaka" }, "subtasks": [], "reporter": { "name": "jnaher", "key": "jnaher", "displayName": "Jebun Naher", "active": false, "timeZone": "Asia/Dhaka" }, "environment": "Appcelerator Command-Line Interface, version 6.1.0\r\nCopyright (c) 2014-2017, Appcelerator, Inc. All Rights Reserved.\r\n\r\nOperating System\r\n Name = Mac OS X\r\n Version = 10.12.4\r\n Architecture = 64bit\r\n # CPUs = 4\r\n Memory = 8.0GB\r\n\r\nNode.js\r\n Node.js Version = 4.2.2\r\n npm Version = 2.14.7\r\n\r\nAppcelerator CLI\r\n Installer = 4.2.8\r\n Core Package = 6.1.0\r\n\r\nTitanium CLI\r\n CLI Version = 5.0.11\r\n node-appc Version = 0.2.39\r\n\r\nTitanium SDKs\r\n \r\n Version = 6.1.0.v20170309181051, 6.0.2GA\r\nDevice : Nexus 7(android 6)", "comment": { "comments": [ { "id": "428891", "author": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "body": "Fused Location Provider would fix this", "updateAuthor": { "name": "topener", "key": "topener", "displayName": "Rene Pot", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-10-10T12:43:14.000+0000", "updated": "2017-10-10T12:43:14.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }