{ "id": "154773", "key": "TIMOB-20356", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2016-02-12T03:14:39.000+0000", "created": "2016-02-05T17:14:05.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "Android", "geolocation", "notable" ], "versions": [ { "id": "17072", "name": "Release 5.1.2", "archived": false, "released": true, "releaseDate": "2016-01-12" }, { "id": "17532", "name": "Release 5.1.1", "archived": false, "released": true, "releaseDate": "2015-11-24" } ], "issuelinks": [ { "id": "50543", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "153597", "key": "TIMOB-20102", "fields": { "summary": "Android 6.0 - 5.1.1.GA - Location permissions missing", "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" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-06-02T19:24:33.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": "h6.Issue Description\r\nTrying to get user location on a device with Marshmallow on Android, the Marshmallow OS should show the geolocation request as described as follows - http://developer.android.com/training/permissions/requesting.html\r\n\r\nh6.Steps to Replicate\r\n# Create a new classic mobile default project \r\n# Paste the next code: \r\n{code}\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\nvar win = Titanium.UI.createWindow({ \r\n title:'Geolocation on Marshallow',\r\n backgroundColor:'#fff'\r\n});\r\n\r\nvar label = Titanium.UI.createLabel({\r\n\tcolor: '#000',\r\n\ttext: 'Tap Me',\r\n\ttextAlign: 'center',\r\n\tleft: 0,\r\n\ttop: 0,\r\n\twidth: Ti.UI.FILL,\r\n\theight: Ti.UI.FILL\r\n});\r\n\r\nTitanium.Geolocation.purpose = 'Get Current Location';\r\n\r\nlabel.addEventListener('click', function (event) {\r\n\tTi.API.error('Calling Ti.Geolocation.getCurrentPosition');\r\n\tif (Ti.Geolocation.locationServicesEnabled) {\r\n\t\tTi.Geolocation.getCurrentPosition(function (event) {\r\n\t\t\tTi.API.error('Ti.Geolocation.getCurrentPosition Callback Success: ' + event.success);\r\n\t\t\t/*\r\n\t \tTi.UI.createAlertDialog({ \r\n\t \t\ttitle: 'Geolocation',\r\n\t \t\tmessage: 'Success: ' + event.success,\r\n\t \t\tok: 'OK'\r\n\t \t}).show();\r\n\t \t*/\r\n\t \t\r\n\t\t\tif (event.error) {\r\n\t Ti.API.error('Error: ' + event.error);\r\n\t } else {\r\n\t Ti.API.info(event.coords);\r\n\t }\r\n\t }); \r\n\t}else{\r\n\t\talert(\"location services not enabled\");\r\n\t} \r\n});\r\n\r\nwin.add(label);\r\nwin.open();\r\n\r\n{code}\r\n# Run on Android Marshmallow device\r\n# Marshmallow geolocation request OS should work as described here: http://developer.android.com/training/permissions/requesting.html", "attachment": [], "flagged": false, "summary": "Android Marshmallow is not showing geolocation request alert", "creator": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Android Marshmallow\r\nSDK 5.1.2", "comment": { "comments": [ { "id": "376293", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "If geolocation permissions are not granted on android 6.0.1 I get an alert {{location services not enabled}} which is the right behaviour.\r\nI am able to see geolocation results on Marshmellow (6.0.1) & SDK 5.1.2.GA\r\nMy logs:\r\n{code}\r\n[ERROR] : Calling Ti.Geolocation.getCurrentPosition\r\n[ERROR] : Ti.Geolocation.getCurrentPosition Callback Success: true\r\n[INFO] : {\"altitude\":0,\"speed\":0,\"longitude\":-121.9131316,\"heading\":0,\"latitude\":37.3678666,\"timestamp\":1454975067563,\"altitudeAccuracy\":null,\"accuracy\":50}\r\n{code}\r\n\r\nNOTE: You might want to do {{JSON.Stringify}} the {{event.coords}}\r\n{code}\r\nTi.API.info(JSON.stringify(event.coords));\r\n{code}\r\nor else it will show {{[Object Object]}}\r\n\r\n\r\nEnvironment:\r\nAppc Studio : 4.5.0.201602070910\r\nTi SDK : 5.1.2.GA\r\nTi CLI : 5.0.6\r\nAlloy : 1.7.33\r\nMAC Yosemite : 10.10.5\r\nAppc NPM : 4.2.3-2\r\nAppc CLI : 5.2.0-249\r\nNode: 4.2.2\r\nNexus 6P - Android 6.0.1", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-02-08T23:54:44.000+0000", "updated": "2016-02-08T23:58:23.000+0000" }, { "id": "376295", "author": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Cool !, the request alert is showing ? ", "updateAuthor": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-02-08T23:56:43.000+0000", "updated": "2016-02-08T23:56:43.000+0000" }, { "id": "376297", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~rramirez], What do you mean by request alert ?\r\nWhen I tap {{Tap Me}} label & if location permissions are not unable I get alert {{location services not enabled}}. The code in the description does not ask for permissions just checks for them.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-02-09T00:02:39.000+0000", "updated": "2016-02-09T00:03:04.000+0000" }, { "id": "376299", "author": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is the expected behavior with the request alert: \r\n\r\n http://developer.android.com/training/permissions/requesting.html \r\n", "updateAuthor": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-02-09T00:04:20.000+0000", "updated": "2016-02-09T00:04:20.000+0000" }, { "id": "376306", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~rramirez], the white colored alert asking requesting for permission will only be seen if you request it. \r\nIf you want to see it then do this :\r\n{code}\r\nlabel.addEventListener('click', function (event) {\r\n\tTi.API.error('Calling Ti.Geolocation.getCurrentPosition');\r\n\tif (Ti.Geolocation.locationServicesEnabled) {\r\n\t\tTi.Geolocation.getCurrentPosition(function (event) {\r\n\t\t\tTi.API.error('Ti.Geolocation.getCurrentPosition Callback Success: ' + event.success);\r\n\t\t\t/*\r\n\t \tTi.UI.createAlertDialog({ \r\n\t \t\ttitle: 'Geolocation',\r\n\t \t\tmessage: 'Success: ' + event.success,\r\n\t \t\tok: 'OK'\r\n\t \t}).show();\r\n\t \t*/\r\n\t \t\r\n\t\t\tif (event.error) {\r\n\t Ti.API.error('Error: ' + event.error);\r\n\t } else {\r\n\t Ti.API.info(JSON.stringify(event.coords));\r\n\t }\r\n\t }); \r\n\t}else{\r\n\t\tTi.Geolocation.requestLocationPermissions();\r\n\t} \r\n});\r\n{code}\r\n", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-02-09T00:52:21.000+0000", "updated": "2016-02-09T00:52:46.000+0000" }, { "id": "376641", "author": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Ok, now I understand, the Android request alert is not automatically prompted if you try to get the position and you don't have the permissions so you need to use the requestLocationPermissions method to show the alert, authorize the permissions and try again to get the position. \r\n\r\nThanks ! ", "updateAuthor": { "name": "rramirez", "key": "rramirez", "displayName": " Ricardo Ramirez", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-02-11T17:51:58.000+0000", "updated": "2016-02-11T17:51:58.000+0000" }, { "id": "376703", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~bimmel] This may need to be clearer in docs.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-02-12T03:14:16.000+0000", "updated": "2016-02-12T03:14:29.000+0000" }, { "id": "376782", "author": { "name": "bimmel-defective", "key": "bimmel", "displayName": "(deactived) Brian Immel", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Added the following statement to http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Geolocation-method-requestLocationPermissions\r\n\"If the user asks for permissions or tries to get unauthorized location information, then the app should call the request method to show the permission settings.\"\r\n\r\nI will publish this updated yml file next week when I push the next set of release notes.", "updateAuthor": { "name": "bimmel-defective", "key": "bimmel", "displayName": "(deactived) Brian Immel", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-02-12T23:23:30.000+0000", "updated": "2016-02-12T23:23:30.000+0000" }, { "id": "420835", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-06-02T19:24:33.000+0000", "updated": "2017-06-02T19:24:33.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }