Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ios): CAPTURE_APPLICATION_BUSY error when dismissing modal by swipe #186

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/ios/CDVCapture.m
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ - (NSUInteger)supportedInterfaceOrientations

@end

@interface CDVAudioRecorderViewController () {
@interface CDVAudioRecorderViewController () <UIAdaptivePresentationControllerDelegate> {
UIStatusBarStyle _previousStatusBarStyle;
}
@end
Expand Down Expand Up @@ -733,6 +733,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 @@ -976,4 +979,8 @@ - (void)viewWillAppear:(BOOL)animated
[super viewWillAppear:animated];
}

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

@end