我在向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