隐私 - 麦克风使用说明权限未出现在iOS 10.3.3中

时间:2017-09-19 10:21:33

标签: ios objective-c iphone xcode ios10.3.2

目前我正在开发录制音频的录音应用程序,因此我在info.plist文件中设置了麦克风权限,因此记录了iOS 10.3.2中显示的audion权限警报,但它没有出现在iOS 10.3.3设备中。

enter image description here

请求许可的代码

let session:AVAudioSession = AVAudioSession.sharedInstance()
    do {
        try session.overrideOutputAudioPort(AVAudioSessionPortOverride.none)

        if (session.responds(to: #selector(AVAudioSession.requestRecordPermission(_:)))) {


            AVAudioSession.sharedInstance().requestRecordPermission({(granted: Bool)-> Void in
                if granted {
                    print("Permission to record granted")
                    self.setSessionPlayAndRecord()
                    if setup {
                        self.setupRecorder()
                    }

                    UIApplication.shared.beginReceivingRemoteControlEvents()
                    self.recorder?.record()

                } else {
                    print("Permission to record not granted")
                }
            })
        } else {
            print("requestRecordPermission unrecognized")
        }


        //Start Record 
       /* self.setSessionPlayAndRecord()
        if setup {
            self.setupRecorder()
        }

        UIApplication.shared.beginReceivingRemoteControlEvents()
        self.recorder?.record()*/



    } catch let error as NSError {
        print("Audio Session error: \(error.localizedDescription)")
    }

由于

0 个答案:

没有答案