我在向iOS 10上的麦克风要求权限时遇到了一个奇怪的问题。我将适当的plist属性(隐私 - 麦克风使用说明)码。在我的手机上,麦克风可以工作/启用,并且可以在手机的应用程序设置中看到它。但是,在朋友的电话上,麦克风要求许可,但话筒选项不会显示在应用程序的设置中。我在这里错过了什么,即使我正确设置了权限?为什么我的手机会在设置中显示选项,但不是我朋友的手机?我有一个iPhone SE,我的朋友有一个iPhone 6s。iOS麦克风选项即使在授予权限的情况下也不在应用程序设置中
的plist属性:
<key>NSMicrophoneUsageDescription</key>
<string>Used to capture microphone input</string>
代码请求许可:
if ([AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeAudio] == AVAuthorizationStatusAuthorized) {
[self configureMicrophone];
}
else {
UIAlertController *deniedAlert = [UIAlertController alertControllerWithTitle:@"Use your microphone?"
message:@"The FOO APP requires access to your microphone to work!"
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *action = [UIAlertAction actionWithTitle:@"Go to Settings" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action){
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
}];
[deniedAlert addAction:action];
[self presentViewController:deniedAlert animated:YES completion:nil];
}
谢谢!
为什么人们反对投票一个非常好的问题吗?问题很清楚,并提供了相关的细节。你还想要什么? – rmaddy