ios: try to leave the meeting when the app is terminating

Fixes: https://github.com/jitsi/jitsi-meet/issues/6665
This commit is contained in:
Saúl Ibarra Corretgé 2020-05-13 15:33:33 +02:00 committed by Saúl Ibarra Corretgé
parent 07f64d94c0
commit b7f1f3c659
3 changed files with 17 additions and 0 deletions

View File

@ -18,6 +18,7 @@
#import "AppDelegate.h" #import "AppDelegate.h"
#import "FIRUtilities.h" #import "FIRUtilities.h"
#import "Types.h" #import "Types.h"
#import "ViewController.h"
@import Crashlytics; @import Crashlytics;
@import Fabric; @import Fabric;
@ -57,6 +58,13 @@
return YES; return YES;
} }
- (void) applicationWillTerminate:(UIApplication *)application {
NSLog(@"Application will terminate!");
// Try to leave the current meeting graceefully.
ViewController *rootController = (ViewController *)self.window.rootViewController;
[rootController terminate];
}
#pragma mark Linking delegate methods #pragma mark Linking delegate methods
- (BOOL)application:(UIApplication *)application - (BOOL)application:(UIApplication *)application

View File

@ -20,4 +20,6 @@
@interface ViewController : UIViewController<JitsiMeetViewDelegate> @interface ViewController : UIViewController<JitsiMeetViewDelegate>
- (void)terminate;
@end @end

View File

@ -102,4 +102,11 @@
} }
#endif #endif
#pragma mark - Helpers
- (void)terminate {
JitsiMeetView *view = (JitsiMeetView *) self.view;
[view leave];
}
@end @end