{ "id": "171010", "key": "TIMOB-25739", "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": [ { "id": "19957", "description": "", "name": "Release 7.1.0", "archived": false, "released": true, "releaseDate": "2018-03-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-02-01T14:39:38.000+0000", "created": "2018-02-01T09:09:24.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "ios", "ios11", "location", "permissions" ], "versions": [ { "id": "19906", "description": "", "name": "Release 6.3.0", "archived": false, "released": true, "releaseDate": "2017-11-01" }, { "id": "19988", "description": "", "name": "Release 7.0.1", "archived": false, "released": true, "releaseDate": "2017-12-21" } ], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2018-02-23T22:58:53.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": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "When asking for Location permissions in iOS 11, the following error is shown, even thought my plist already have these keys:\r\n\r\n{code:java}[ERROR] : The NSLocationAlwaysAndWhenInUseUsageDescription, NSLocationAlwaysUsageDescription and NSLocationAlwaysAndWhenInUseUsageDescription key must be defined in your tiapp.xml in order to request this permission.{code}\r\n\r\n\r\nThis is the ios part of the tiapp.xml. I've also opened the generated Info.plist file and it looks good.\r\n\r\n{code:java}\r\n\r\n true\r\n true\r\n \r\n \r\n NSLocationAlwaysUsageDescription\r\n Can we use geolocation?\r\n NSLocationAlwaysAndWhenInUseUsageDescription\r\n Can we use geolocation?\r\n UISupportedInterfaceOrientations~iphone\r\n \r\n UIInterfaceOrientationPortrait\r\n \r\n UISupportedInterfaceOrientations~ipad\r\n \r\n UIInterfaceOrientationPortrait\r\n \r\n UIRequiresPersistentWiFi\r\n \r\n UIPrerenderedIcon\r\n \r\n UIStatusBarHidden\r\n \r\n UIStatusBarStyle\r\n UIStatusBarStyleDefault\r\n \r\n \r\n \r\n{code}\r\n\r\n\r\nIn order to reproduce the issue, this is an example code, on an normal app, inside app.js (I've also attached the file)\r\n\r\n{code:java}\r\nvar win = Ti.UI.createWindow({layout:'vertical'});\r\nvar label = Ti.UI.createLabel({top:30,width:'90%',height:Ti.UI.SIZE});\r\n\r\nwin.addEventListener('open',function(){\r\n\tTi.Geolocation.requestLocationPermissions(Ti.Geolocation.AUTHORIZATION_ALWAYS, function(e){ apiInfo(JSON.stringify(e)); });\r\n});\r\n\r\nfunction apiInfo(msg) {\r\n\tTitanium.UI.createAlertDialog({\r\n\t\ttitle: \"info\",\r\n\t\tmessage:msg\r\n\t}).show();\r\n};\r\n\r\nwin.add(label);\r\nwin.open();\r\n{code}\r\n\r\n\r\n\r\nThanks for having a look", "attachment": [ { "id": "64792", "filename": "app.js", "author": { "name": "dfalcon", "key": "dfalcon", "displayName": "Daniel Falcon", "active": true, "timeZone": "Europe/Zurich" }, "created": "2018-02-01T09:07:48.000+0000", "size": 425, "mimeType": "text/javascript" } ], "flagged": false, "summary": "iOS 11: Location permissions do not indicate missing \"WhenInUse\" privacy-key", "creator": { "name": "dfalcon", "key": "dfalcon", "displayName": "Daniel Falcon", "active": true, "timeZone": "Europe/Zurich" }, "subtasks": [], "reporter": { "name": "dfalcon", "key": "dfalcon", "displayName": "Daniel Falcon", "active": true, "timeZone": "Europe/Zurich" }, "environment": "iPhone emulator (tested in all versions from 5S to X), iOS 11\r\nTested in Titanium SDK 6.3.0.GA, 7.0.0.GA, 7.0.1.GA", "closedSprints": [ { "id": 1000, "state": "closed", "name": "2018 Sprint 04 SDK", "startDate": "2018-02-12T04:23:01.913Z", "endDate": "2018-02-26T04:23:00.000Z", "completeDate": "2018-02-26T19:36:01.769Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "433928", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Investgating now, keeping this ticket updated.\r\n\r\n*EDIT*: It requires the \"WhenInUse\" description {{NSLocationWhenInUseUsageDescription}} permission to be set as well, which should also be in the error message that has a typo in it to mention {{NSLocationAlwaysAndWhenInUseUsageDescription}} twice. So as a workaround, simple add the {{NSLocationWhenInUseUsageDescription}} as well and I'll adjust the core to fix the alert. And thinking about it, I don't remember why I've made the \"WhenInUse\" key required for \"Always\" use-cases, it shouldn't even be used. So probably that will go away as well.\r\n\r\n*EDIT 2*: I remember why! Apple [documents|https://developer.apple.com/documentation/corelocation/choosing_the_authorization_level_for_location_services/requesting_always_authorization] to have all three flags set because the user can downgrade permissions in iOS 11 due to privacy \"improvements\". I'll fix the typo inside the error anyway. Quote Apple:\r\n{quote}\r\nAdd the NSLocationWhenInUseUsageDescription key and the NSLocationAlwaysAndWhenInUseUsageDescription key to your Info.plist file. (Xcode displays these keys as \"Privacy - Location When In Use Usage Description\" and \"Privacy - Location Always and When In Use Usage Description\" in the Info.plist editor.)\r\n{quote}\r\n\r\nSummary: Add the following key to your section in the tiapp.xml and you'll have a good life:\r\n{code:xml}\r\nNSLocationWhenInUseUsageDescription\r\nCan we access your location when using the app\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-02-01T09:16:08.000+0000", "updated": "2018-02-01T11:34:06.000+0000" }, { "id": "433937", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/9789", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-02-01T11:38:16.000+0000", "updated": "2018-02-01T11:38:16.000+0000" }, { "id": "433940", "author": { "name": "dfalcon", "key": "dfalcon", "displayName": "Daniel Falcon", "active": true, "timeZone": "Europe/Zurich" }, "body": "Hi Hans,\r\n\r\nIndeed, adding the missing NSLocationWhenInUseUsageDescription fixes the issue.\r\n\r\nThanks for the quick answer!", "updateAuthor": { "name": "dfalcon", "key": "dfalcon", "displayName": "Daniel Falcon", "active": true, "timeZone": "Europe/Zurich" }, "created": "2018-02-01T12:17:42.000+0000", "updated": "2018-02-01T12:17:42.000+0000" }, { "id": "434851", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR already merged and the permissions and error message are now accurate and improved.", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2018-02-23T22:58:53.000+0000", "updated": "2018-02-23T22:58:53.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }