{ "id": "155598", "key": "TIMOB-20544", "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": "17608", "name": "Release 6.1.0", "archived": false, "released": true, "releaseDate": "2017-05-26" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-05-06T14:35:21.000+0000", "created": "2016-03-10T12:32:34.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "merge-6.1.0" ], "versions": [ { "id": "17993", "description": "Release 5.2.2", "name": "Release 5.2.2", "archived": false, "released": true, "releaseDate": "2016-04-05" } ], "issuelinks": [ { "id": "51630", "type": { "id": "10120", "name": "Gantt: finish-start", "inward": "has to be done after", "outward": "has to be done before" }, "inwardIssue": { "id": "61660", "key": "TIMOB-1028", "fields": { "summary": "Android: Implement AudioRecorder", "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": "Low", "id": "4" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } }, { "id": "50994", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "150517", "key": "TIMOB-19375", "fields": { "summary": "Android: Android M new runtime permissions model", "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": "5", "description": "The sub-task of the issue", "name": "Sub-task", "subtask": true } } } }, { "id": "51503", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "154687", "key": "TIMOB-20320", "fields": { "summary": "Android: Provide generic requestPermission(s) method", "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": "High", "id": "2" }, "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-05-11T00:02:45.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" }, { "id": "10206", "name": "iOS", "description": "iOS Platform" }, { "id": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "To request permission for using the currently iOS and Windows only Ti.Media.AudioRecorder you need [Ti.Media.requestAuthorization()|http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media-method-requestAuthorization]\r\n\r\nTo achieve parity and consistency with other new permission APIs we need:\r\n\r\n* To deprecate {{Ti.Media.requestAuthorization()}}\r\n* To add {{Ti.Media.requestRecorderPermission()}} for iOS and Windows\r\n\r\nWhile we're at it we should also resolve TIMOB-1028 to bring Ti.Media.AudioRecorder to Android\r\n\r\nReported on SO:\r\nhttp://stackoverflow.com/questions/35890378/titanium-studio-audio-recording-request-permission-on-android-6-0", "attachment": [], "flagged": false, "summary": "Align permission methods Ti.Media.AudioRecorder with the others", "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": null, "comment": { "comments": [ { "id": "383080", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "This needs more priority:\r\n\r\n* http://stackoverflow.com/questions/36683249/android-6-0-audio-permissions-and-titanium-jar-in-5-2-2ga\r\n* http://stackoverflow.com/questions/35890378/how-to-request-run-time-recording-permission-on-android-6-0", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-04-19T07:25:49.000+0000", "updated": "2016-04-19T07:25:49.000+0000" }, { "id": "384014", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "With TIMOB-20320 merged into 5.4.0, you can now do this:-\r\n{code}\r\nvar audioPermission = \"android.permission.RECORD_AUDIO\";\r\nvar hasAudioPerm = Ti.Android.hasPermission(audioPermission);\r\nvar permissionsToRequest = [];\r\nif (!hasAudioPerm) {\r\n permissionsToRequest.push(audioPermission);\r\n} \r\nif (permissionsToRequest.length > 0) {\r\n Ti.Android.requestPermissions(permissionsToRequest, function(e) {\r\n if (e.success) {\r\n Ti.API.info(\"SUCCESS\");\r\n } else {\r\n Ti.API.info(\"ERROR: \" + e.error);\r\n }\r\n });\r\n}\r\n{code}\r\n\r\nThat would give you RECORD_AUDIO permission.\r\n\r\nThat aside, from my understanding based on this doc, http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media.AudioRecorder is not supported/available in Android. Am I missing something? [~fokkezb]\r\n", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-04-27T03:01:43.000+0000", "updated": "2016-04-27T03:01:43.000+0000" }, { "id": "384859", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "We should implement Ti.Media.AudioRecorder for Android first and then align the permission methods with the other APIs\r\n\r\nTIMOB-1028", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-05-05T14:52:29.000+0000", "updated": "2016-05-05T14:52:29.000+0000" }, { "id": "385635", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~rramirez] This would allow you to get the other permissions in 5.4.0. If everything else is okay, I would think this ticket does not require any more action done on it. Let me know if it suffices. \r\n{code}\r\n\r\nvar audioPermission = \"android.permission.RECORD_AUDIO\";\r\nvar hasAudioPerm = Ti.Android.hasPermission(audioPermission);\r\n\r\nvar storagePermission = \"android.permission.READ_EXTERNAL_STORAGE\";\r\nvar hasStoragePerm = Ti.Android.hasPermission(storagePermission);\r\n\r\nvar permissionsToRequest = [];\r\nif (!hasAudioPerm) {\r\n permissionsToRequest.push(audioPermission);\r\n} \r\nif (!hasStoragePerm) {\r\n permissionsToRequest.push(storagePermission);\r\n} \r\nif (permissionsToRequest.length > 0) {\r\n Ti.Android.requestPermissions(permissionsToRequest, function(e) {\r\n if (e.success) {\r\n Ti.API.info(\"SUCCESS\");\r\n } else {\r\n Ti.API.info(\"ERROR: \" + e.error);\r\n }\r\n });\r\n}\r\n{code}", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-05-13T06:46:52.000+0000", "updated": "2016-05-13T06:46:52.000+0000" }, { "id": "403896", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "titanium_mobile_windows: https://github.com/appcelerator/titanium_mobile_windows/pull/909\r\n\r\nMerged!", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-12-28T17:20:49.000+0000", "updated": "2016-12-28T17:21:27.000+0000" }, { "id": "403906", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Looks like we still need iOS to be aligned here. [~vijaysingh]", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-12-29T02:21:28.000+0000", "updated": "2016-12-29T02:21:28.000+0000" }, { "id": "403907", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "IN iOS I can see -\r\nTi.Media.requestAuthorization() is deprecated and new api Ti.Media. requestAudioPermissions() introduced in \"5.1.0\" .\r\n", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-12-29T03:05:04.000+0000", "updated": "2016-12-29T03:05:04.000+0000" }, { "id": "403908", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Right but in this scenario i think we wanted requestRecorderPermissions().", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-12-29T03:38:58.000+0000", "updated": "2016-12-29T03:38:58.000+0000" }, { "id": "405045", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (for iOS) : https://github.com/appcelerator/titanium_mobile/pull/8767\r\n\r\nTest code - \r\n\r\n\r\n{code:java}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n\r\nvar btn = Ti.UI.createButton({\r\n title: 'Trigger'\r\n});\r\n\r\nbtn.addEventListener('click', function() {\r\n Ti.Media.requestAudioRecorderPermissions(function(e){\r\n if (e.success) {\r\n Ti.API.info('permission granted');\r\n }\r\n else {\r\n console.error(e);\r\n }\r\n\r\n });\r\n});\r\n\r\nwin.add(btn);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-01-23T04:29:52.000+0000", "updated": "2017-03-27T06:55:50.000+0000" }, { "id": "405053", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Some issue that appear in the iOS PR but will other effect other platforms:\r\n- We use the plural when requesting permissions (e.g. {{requestLocationPermissions}}, {{requestCalendarPermissions}} and {{requestContactsPermissions}}), but in this case it's singular\r\n- The method is called {{requestRecorderPermission}}, but it should rather be {{recordAudioRecorderPermissions}} to avoid API confusions\r\n- There is still no Android and Windows implementation. We should use this ticket and PR to align that platform as well\r\n\r\nSo question: [~gmathews] Looking at the merge-date of your Windows PR, it should not be included in any SDK so far. Can you still rename it without causing problems? I don't see docs-updates, so we might want to add those as well.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-01-23T10:35:27.000+0000", "updated": "2017-03-24T09:48:56.000+0000" }, { "id": "415528", "author": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~hansknoechel],\r\n\r\n{quote}\r\nThe method is called {{requestRecorderPermission}}, but it should rather be {{recordAudioRecorderPermissions}} to avoid API confusions\r\n{quote}\r\n\r\n{{requestAudioRecorderPermissions}}, right? (I saw your comment on [PR 8767|https://github.com/appcelerator/titanium_mobile/pull/8767])\r\nThat sounds good to me, pushed https://github.com/appcelerator/titanium_mobile_windows/pull/965\r\n", "updateAuthor": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-24T05:07:02.000+0000", "updated": "2017-03-24T05:07:02.000+0000" }, { "id": "415532", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks Kota, looks good! Waiting for [~vijaysingh] to do the iOS change then, and Android of course. ", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-03-24T09:50:44.000+0000", "updated": "2017-03-24T09:50:44.000+0000" }, { "id": "415855", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "iOS changes done.", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-03-27T04:41:26.000+0000", "updated": "2017-03-27T04:41:26.000+0000" }, { "id": "417245", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~hansknoechel]\r\nBackported PR(6_1_X): https://github.com/appcelerator/titanium_mobile/pull/8955", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-04-12T03:39:51.000+0000", "updated": "2017-04-12T03:39:51.000+0000" }, { "id": "419231", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified on Windows using SDK 6.2.0.v20170505081953 and 6.1.0.v20170504175418 ", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-05-05T21:50:45.000+0000", "updated": "2017-05-05T21:50:45.000+0000" }, { "id": "419525", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified on Titanium SDK: 6.2.0.v20170510084833 and 6.1.0.v20170509170935. Windows was verified earlier on SDK 6.2.0.v20170505081953 and 6.1.0.v20170504175418. Test and other information can be found at: \r\n\r\n6_1_X (Windows): https://github.com/appcelerator/titanium_mobile_windows/pull/979 \r\n6_1_X(iOS): https://github.com/appcelerator/titanium_mobile/pull/8955\r\nMaster(Windows): https://github.com/appcelerator/titanium_mobile_windows/pull/965\r\nMaster(iOS): https://github.com/appcelerator/titanium_mobile/pull/8767", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-05-11T00:02:30.000+0000", "updated": "2017-05-11T00:02:30.000+0000" } ], "maxResults": 37, "total": 37, "startAt": 0 } } }