Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect when user denies access to camera

NOTE: My questions is not a duplicate of questions asking HOW to detect if the user has denied access.

I saw a lot of code on HOW to detect if the user has given access to the camera, but I'd need to know WHEN the user denies access.

My scenario is the next:

User opens view A, A asks for access to the camera, pop up appears, user denies access, user is redirected to B.

Is this possible?

like image 948
Antonio MG Avatar asked Jul 13 '15 16:07

Antonio MG


1 Answers

Actually, there's a way of doing it:

 [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {
        if(granted){
            NSLog(@"Granted access");
        } else {
            NSLog(@"Not granted access");
        }
    }];
like image 90
Antonio MG Avatar answered Oct 20 '22 00:10

Antonio MG