Skip to content

Commit

Permalink
fix(ios): CAPTURE_APPLICATION_BUSY error when dismissing modal by swi…
Browse files Browse the repository at this point in the history
…pe (#278)

Co-authored-by: Denis Kovalev <[email protected]>
  • Loading branch information
erisu and BardRedStar authored Aug 9, 2023
1 parent 7d1701d commit 9e9b73a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ios/CDVCapture.m
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ - (UIInterfaceOrientationMask)supportedInterfaceOrientations

@end

@interface CDVAudioRecorderViewController () {
@interface CDVAudioRecorderViewController () <UIAdaptivePresentationControllerDelegate> {
UIStatusBarStyle _previousStatusBarStyle;
}
@end
Expand Down Expand Up @@ -737,6 +737,9 @@ - (void)viewDidLoad
UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, nil);
NSError* error = nil;

// Add delegate to catch the dismiss event
self.navigationController.presentationController.delegate = self;

if (self.avSession == nil) {
// create audio session
self.avSession = [AVAudioSession sharedInstance];
Expand Down Expand Up @@ -946,4 +949,8 @@ - (void)audioRecorderEncodeErrorDidOccur:(AVAudioRecorder*)recorder error:(NSErr
[self dismissAudioView:nil];
}

- (void)presentationControllerDidDismiss:(UIPresentationController *)presentationController {
[self dismissAudioView:nil];
}

@end

0 comments on commit 9e9b73a

Please sign in to comment.