iOS check if application has access to microphone -
With the introduction of iOS 7, whenever they want to record the audio, the application must request microphone access < / P>
How do I check whether the application has access to the microphone? In IOS 8 SDK, I can use the AVAudioSessionRecordPermission
enum, but how do I check it in iOS? 7?
INFO:
I do not want to request permission, I just want to know if the app has access to the microphone (like location access):
If ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied) {// do something}
iOS7
There is no way to obtain the current state of the microphone authority
. IOS8
As iOS7
you must request permission [[AVAudioSession sharedInstance] requestRecordPermission: ^ (Bul approved) { If (given) {nslog (@ "allowed"); } Other {nslog (@ "Permission denied"); }}];
The same question has been asked earlier but there is no such API with which you are present as iOS8
Know the situation.
Solution:
Another option is that you can show popup
or for the first time and NSUserDefaults
to save the states of the selected user option and do not ask for permission since then. You do not need to call this explicitly with Docs, if you do not have to get all the user permission. When you try to record it will automatically call for the first time by AVAudioSession
The recording audio requires explicit permission from the user. The first time when your app's audio session tries to use an audio input path, using the category that enables the recording (see "Audio session categories"), the system automatically allows the user to Indicates; Alternatively, you can call requestRecordPermission:
Comments
Post a Comment