Bradley Snyder
Bradley Snyder

Reputation: 228

AVAudioSession requestRecordPermission with custom prompt?

I just installed the Square Register app on my iPhone 5S. When it first opened, it requested microphone access as expected, but what caught my eye was that it had a customized prompt explaining why it needed microphone access. I'm currently developing an app the requires microphone access and I'd like to be able to do this as well. The documentation for requestRecordPermission seems to suggest that there is no such option available. Did Apple give this developer special access to undocumented iOS 7 features, or am I missing something?

Upvotes: 8

Views: 2937

Answers (2)

Rudi
Rudi

Reputation: 4314

in Xcode 8 and iOS 10 you should manually add

Privacy - Microphone Usage Description

to your plist file

Upvotes: 1

TonyMkenu
TonyMkenu

Reputation: 7667

Yes, there is... but for iOS7 and later...

in you app.plist add this key: NSMicrophoneUsageDescription and your desired customized prompt. More details here: https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW1

Upvotes: 8

Related Questions