Search code examples
iosobjective-ccameraalertplist

How to get the permission alert click event in (.plist) privacy usage description?


In the plist setting "Privacy - Camera Usage Description", it shows a permission alert to allow or deny usage of the camera.

How can I get the alert's accept or refuse button event to do something? Here is my .plist file snapshot:


Solution

  • Request camera permission using

    AVCaptureDevice.requestAccess(for: AVMediaType.video) { granted in }
    

    and you'll get the user's response in the granted parameter of the closure.