{ "id": "153236", "key": "TIMOB-20003", "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": "17072", "name": "Release 5.1.2", "archived": false, "released": true, "releaseDate": "2016-01-12" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-11-23T03:06:58.000+0000", "created": "2015-11-17T13:34:54.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "14826", "description": "Release 5.1.0-remaining iOS9 features, Android M features", "name": "Release 5.1.0", "archived": false, "released": true, "releaseDate": "2015-11-20" } ], "issuelinks": [], "assignee": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "updated": "2015-12-07T19:12:08.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "The following code demonstrates that when you deny permission, the error messages in the callback payload are prefixed by the _namespace_ followed by no spacing. Expected behaviour is not to have a prefix at all.\r\n\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: 'white'\r\n});\r\n\r\nvar btn = Ti.UI.createButton({\r\n\ttitle: 'Request Permissions'\r\n});\r\n\r\nbtn.addEventListener('click', function(e) {\r\n\r\n\tTi.Calendar.requestCalendarPermissions(function(e) {\r\n\t\tconsole.log('Ti.Calendar.requestCalendarPermissions ' + JSON.stringify(e, null, 2));\r\n\t});\r\n\r\n\tTi.Contacts.requestContactsPermissions(function(e) {\r\n\t\tconsole.log('Ti.Contacts.requestContactsPermissions ' + JSON.stringify(e, null, 2));\r\n\t});\r\n\r\n\tTi.Geolocation.requestLocationPermissions(Ti.Geolocation.AUTHORIZATION_ALWAYS, function(e) {\r\n\t\tconsole.log('Ti.Geolocation.requestLocationPermissions ' + JSON.stringify(e, null, 2));\r\n\t});\r\n\r\n\tTi.Media.requestCameraPermissions(function(e) {\r\n\t\tconsole.log('Ti.Media.requestCameraPermissions ' + JSON.stringify(e, null, 2));\r\n\t});\r\n\r\n});\r\n\r\nwin.add(btn);\r\nwin.open();\r\n\r\n// So the required users-permissions are added to AndroidManifest.xml\r\nfunction foo() {\r\n\tTi.Calendar.getAllCalendars();\r\n\tTi.Contacts.getAllGroups();\r\n\tTi.Media.showCamera();\r\n}\r\n{code}\r\n\r\n*Console*\r\n\r\n{code}\r\n11-17 14:11:46.421: I/TiAPI(5178): Ti.Media.requestCameraPermissions {\r\n11-17 14:11:46.421: I/TiAPI(5178): \"error\": \"CameraOne or more permission(s) were denied\",\r\n11-17 14:11:46.421: I/TiAPI(5178): \"code\": -1,\r\n11-17 14:11:46.421: I/TiAPI(5178): \"success\": false\r\n11-17 14:11:46.421: I/TiAPI(5178): }\r\n11-17 14:11:46.422: I/TiAPI(5178): Ti.Geolocation.requestLocationPermissions {\r\n11-17 14:11:46.422: I/TiAPI(5178): \"error\": \"LocationOne or more permission(s) were denied\",\r\n11-17 14:11:46.422: I/TiAPI(5178): \"code\": -1,\r\n11-17 14:11:46.422: I/TiAPI(5178): \"success\": false\r\n11-17 14:11:46.422: I/TiAPI(5178): }\r\n11-17 14:11:46.422: I/TiAPI(5178): Ti.Contacts.requestContactsPermissions {\r\n11-17 14:11:46.422: I/TiAPI(5178): \"error\": \"ContactsOne or more permission(s) were denied\",\r\n11-17 14:11:46.422: I/TiAPI(5178): \"code\": -1,\r\n11-17 14:11:46.422: I/TiAPI(5178): \"success\": false\r\n11-17 14:11:46.422: I/TiAPI(5178): }\r\n11-17 14:11:46.422: I/TiAPI(5178): Ti.Calendar.requestCalendarPermissions {\r\n11-17 14:11:46.422: I/TiAPI(5178): \"error\": \"CalendarOne or more permission(s) were denied\",\r\n11-17 14:11:46.422: I/TiAPI(5178): \"code\": -1,\r\n11-17 14:11:46.422: I/TiAPI(5178): \"success\": false\r\n11-17 14:11:46.422: I/TiAPI(5178): }\r\n{code}\r\n\r\nRelated code:\r\nhttps://github.com/appcelerator/titanium_mobile/blob/a0e6b6545594b64d95dc91a496e3242342de9db1/android/titanium/src/java/org/appcelerator/titanium/TiBaseActivity.java#L440", "attachment": [], "flagged": false, "summary": "Permission request error response message prefixed with namespace", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "SDK 5.1.0.v20151116104422", "closedSprints": [ { "id": 529, "state": "closed", "name": "2015 Sprint 24 SDK", "startDate": "2015-11-21T01:30:12.670Z", "endDate": "2015-12-05T01:30:00.000Z", "completeDate": "2015-12-07T03:57:17.094Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "370520", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/7458", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-11-17T13:36:12.000+0000", "updated": "2015-11-17T13:36:12.000+0000" }, { "id": "370959", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Approved! But if we want this in 5.1.1, we need a 5_1_X backport by time. Will wait to resolve until that decision is cleared. /cc [~cng]", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-11-20T05:27:24.000+0000", "updated": "2015-11-20T05:30:08.000+0000" }, { "id": "370960", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "yes we need that back port. Then once we merge next week for 5.1.1, we will resolve this ticket.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-11-20T05:35:21.000+0000", "updated": "2015-11-20T05:35:21.000+0000" }, { "id": "370974", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "PR for 5_1_X: https://github.com/appcelerator/titanium_mobile/pull/7478", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-11-20T09:14:12.000+0000", "updated": "2015-11-20T09:14:12.000+0000" }, { "id": "371087", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Backport approved!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-11-23T03:06:53.000+0000", "updated": "2015-11-23T03:06:53.000+0000" }, { "id": "371197", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed, using:\r\n\r\nMacOS 10.11.2 (15C47a)\r\nStudio 4.4.0.201511182122\r\nTi SDK 5.1.1.v20151122191220\r\nAppc NPM 4.2.2\r\nAppc CLI 5.1.0\r\nTi CLI 5.0.5\r\nAlloy 1.7.26\r\nArrow 1.3.22\r\nXcode 7.1 (7B91b)\r\nNode v0.12.7\r\nJava 1.7.0_80\r\nproduction\r\n\r\nThe error response for denied permissions is not prefixed with the namespace. Used the test code provided and denied permissions via the prompt as well as not defining them in the tiapp.", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-11-23T18:55:43.000+0000", "updated": "2015-11-23T18:55:43.000+0000" }, { "id": "371512", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "To Note: This ticket is marked 5.1.2 but PR was merged in 5.1.1GA", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-11-26T03:50:23.000+0000", "updated": "2015-11-26T03:50:23.000+0000" }, { "id": "372329", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix with SDK 5.1.2.v20151206185250 as well", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-12-07T19:12:08.000+0000", "updated": "2015-12-07T19:12:08.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }