Microphone

Vikas Kore
2 min readApr 23, 2021

--

An instrument for converting sound waves into electrical energy variations which may then be amplified, transmitted, or recorded.

In this blog we will understand what is microphone, why and when we need permission in iOS app and how to know a app accessing our microphone or camera.

Permission

If our app have voice record functionality then we need to ask microphone permission to app users.

Starting with iOS 10, you must set the NSMicrophoneUsageDescription property in your info.plist for microphone permissions and include a message for the user.

This message is shown to the user at time of the request.

To ask permission we will code like this

If you have to implement any logic based on user response then you have this Switch case to do

Wow! our implementation is done.

Allow or Deny from settings

Open the Settings app. Tap on a app you want to allow or deny microphone permisison > Use switch for your decision.

How to see which apps are using your microphone

dsdf
An orange indicator means the microphone is being used by an app on your iPhone
I am using Whatsapp to record and send voice message, Orange indicator come up near battery, check this screenshot
A green indicator means either the camera or the camera and the microphone are being used by an app on your iPhone
Here I can see green indicator while using Whatsapp to set status using Camera
Also, if you open control center it will tell you what app was using the camera or microphone

Thank you, Happy coding!

--

--

Vikas Kore
Vikas Kore

No responses yet