[TIMOB-20544] Align permission methods Ti.Media.AudioRecorder with the others
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-05-06T14:35:21.000+0000 |
Affected Version/s | Release 5.2.2 |
Fix Version/s | Release 6.1.0 |
Components | Android, iOS, Windows |
Labels | android, merge-6.1.0 |
Reporter | Fokke Zandbergen |
Assignee | Vijay Singh |
Created | 2016-03-10T12:32:34.000+0000 |
Updated | 2017-05-11T00:02:45.000+0000 |
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)
To achieve parity and consistency with other new permission APIs we need:
* To deprecate
Ti.Media.requestAuthorization()
* To add Ti.Media.requestRecorderPermission()
for iOS and Windows
While we're at it we should also resolve TIMOB-1028 to bring Ti.Media.AudioRecorder to Android
Reported on SO:
http://stackoverflow.com/questions/35890378/titanium-studio-audio-recording-request-permission-on-android-6-0
This needs more priority: * http://stackoverflow.com/questions/36683249/android-6-0-audio-permissions-and-titanium-jar-in-5-2-2ga * http://stackoverflow.com/questions/35890378/how-to-request-run-time-recording-permission-on-android-6-0
With TIMOB-20320 merged into 5.4.0, you can now do this:-
That would give you RECORD_AUDIO permission. That 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]
We should implement Ti.Media.AudioRecorder for Android first and then align the permission methods with the other APIs TIMOB-1028
[~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.
titanium_mobile_windows: https://github.com/appcelerator/titanium_mobile_windows/pull/909 Merged!
Looks like we still need iOS to be aligned here. [~vijaysingh]
IN iOS I can see - Ti.Media.requestAuthorization() is deprecated and new api Ti.Media. requestAudioPermissions() introduced in "5.1.0" .
Right but in this scenario i think we wanted requestRecorderPermissions().
PR (for iOS) : https://github.com/appcelerator/titanium_mobile/pull/8767 Test code -
Some issue that appear in the iOS PR but will other effect other platforms: - We use the plural when requesting permissions (e.g.
requestLocationPermissions
,requestCalendarPermissions
andrequestContactsPermissions
), but in this case it's singular - The method is calledrequestRecorderPermission
, but it should rather berecordAudioRecorderPermissions
to avoid API confusions - There is still no Android and Windows implementation. We should use this ticket and PR to align that platform as well So 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.[~hansknoechel], {quote} The method is called
requestRecorderPermission
, but it should rather berecordAudioRecorderPermissions
to avoid API confusions {quote}requestAudioRecorderPermissions
, right? (I saw your comment on [PR 8767](https://github.com/appcelerator/titanium_mobile/pull/8767)) That sounds good to me, pushed https://github.com/appcelerator/titanium_mobile_windows/pull/965Thanks Kota, looks good! Waiting for [~vijaysingh] to do the iOS change then, and Android of course.
iOS changes done.
[~hansknoechel] Backported PR(6_1_X): https://github.com/appcelerator/titanium_mobile/pull/8955
Verified on Windows using SDK 6.2.0.v20170505081953 and 6.1.0.v20170504175418
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: 6_1_X (Windows): https://github.com/appcelerator/titanium_mobile_windows/pull/979 6_1_X(iOS): https://github.com/appcelerator/titanium_mobile/pull/8955 Master(Windows): https://github.com/appcelerator/titanium_mobile_windows/pull/965 Master(iOS): https://github.com/appcelerator/titanium_mobile/pull/8767