Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

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

Saúl Ibarra Corretgéb7f1f3c659bf
diff --git a/ios/app/src/AppDelegate.m b/ios/app/src/AppDelegate.m
index 237466c5c4..27025675d5 100644
--- a/ios/app/src/AppDelegate.m
+++ b/ios/app/src/AppDelegate.m
@@ -18,6 +18,7 @@
#import "AppDelegate.h"
#import "FIRUtilities.h"
#import "Types.h"
+#import "ViewController.h"
@import Crashlytics;
@import Fabric;
@@ -57,6 +58,13 @@
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
- (BOOL)application:(UIApplication *)application
diff --git a/ios/app/src/ViewController.h b/ios/app/src/ViewController.h
index 048427e560..ec37977570 100644
--- a/ios/app/src/ViewController.h
+++ b/ios/app/src/ViewController.h
@@ -20,4 +20,6 @@
@interface ViewController : UIViewController<JitsiMeetViewDelegate>
+- (void)terminate;
+
@end
diff --git a/ios/app/src/ViewController.m b/ios/app/src/ViewController.m
index 6643d9ccf9..4172c0e799 100644
--- a/ios/app/src/ViewController.m
+++ b/ios/app/src/ViewController.m
@@ -102,4 +102,11 @@
}
#endif
+#pragma mark - Helpers
+
+- (void)terminate {
+ JitsiMeetView *view = (JitsiMeetView *) self.view;
+ [view leave];
+}
+
@end