Using a bluetooth sound device in iOS7 without microphone permissions

不想你离开。 提交于 2019-12-11 02:08:51

问题


With the iOS7 the AudioSession Category AVAudioSessionCategoryPlayAndRecord asks for Microphone permission. However, that permission doesn't feel right if I only need to support bluetooth for external audio. There are some people that are in the same situation as I am right now, but I can't find an answer for this.

In iOS6 I was using this code to route the sound to bluetooth devices:

[[AVAudioSession sharedInstance] setDelegate:self];
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord 
                                       error:&sessionError];

AudioSessionSetActive (true);

UInt32 audioCategory = kAudioSessionCategory_MediaPlayback;

AudioSessionSetProperty (kAudioSessionProperty_AudioCategory, 
                         sizeof (audioCategory), &audioCategory);

Is there any way to support a bluetooth device without using a audio session category that asks the user permission to use the microphone?

PS: I have noticed that google does the same with maps and youtube. Is it possible that we can't get around this issue on iOS7?


回答1:


The "Allow app to use Microphone" prompt has been put in place to give the user more confidence in what the application is interfacing with. There will be no way to get around this.

You can however respond on the event of the user denying access. This might help:

How to detect microphone input permission refused in iOS 7



来源:https://stackoverflow.com/questions/18916044/using-a-bluetooth-sound-device-in-ios7-without-microphone-permissions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!