File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,11 @@ + (void) checkCameraPermissionsForViewController: (UIViewController *) viewContr
3434 break ;
3535 }
3636 case AVAuthorizationStatusNotDetermined: {
37- [AVCaptureDevice requestAccessForMediaType: AVMediaTypeVideo completionHandler: complete];
37+ [AVCaptureDevice requestAccessForMediaType: AVMediaTypeVideo completionHandler: ^(BOOL granted) {
38+ dispatch_async (dispatch_get_main_queue (), ^{
39+ complete (granted);
40+ });
41+ }];
3842 break ;
3943 }
4044 case AVAuthorizationStatusRestricted: {
@@ -92,7 +96,11 @@ + (void) checkMicrophonePermissionsForViewController: (UIViewController *) viewC
9296 break ;
9397 }
9498 case AVAuthorizationStatusNotDetermined: {
95- [AVCaptureDevice requestAccessForMediaType: AVMediaTypeAudio completionHandler: complete];
99+ [AVCaptureDevice requestAccessForMediaType: AVMediaTypeAudio completionHandler: ^(BOOL granted) {
100+ dispatch_async (dispatch_get_main_queue (), ^{
101+ complete (granted);
102+ });
103+ }];
96104 break ;
97105 }
98106 case AVAuthorizationStatusRestricted: {
You can’t perform that action at this time.
0 commit comments