cordova-plugin-media-capture
cordova-plugin-media-capture copied to clipboard
iOS: Fixed UI issues with main thread and added alert for permission.
- solved critical error connected with performing the UI operation on the non-UI thread.
- added the alert dialog for the Microphone permission, if it is not granted.
Platforms affected
iOS
Motivation and Context
App was crashing, when user didn't give permissions for recording audio.
Description
iOS requests the permission on the background thread, and after it all of the operations should be performed on the main thread. So, I got a crash, when attempting to reject the Microphone permission prompt. Basically I change thread after the request for permissions.
Testing
I have ran tests, and haven’t got any error.
Checklist
- [X] I've run the tests to see all new and existing tests pass
- [X] I added automated test coverage as appropriate for this change
- [X] Commit is prefixed with
(platform)
if this change only applies to one platform (e.g.(android)
) - [X] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
- [X] I've updated the documentation if necessary