瀏覽代碼

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

Fixes: https://github.com/jitsi/jitsi-meet/issues/6665
master
Saúl Ibarra Corretgé 5 年之前
父節點
當前提交
b7f1f3c659
共有 3 個文件被更改,包括 17 次插入0 次删除
  1. 8
    0
      ios/app/src/AppDelegate.m
  2. 2
    0
      ios/app/src/ViewController.h
  3. 7
    0
      ios/app/src/ViewController.m

+ 8
- 0
ios/app/src/AppDelegate.m 查看文件

@@ -18,6 +18,7 @@
18 18
 #import "AppDelegate.h"
19 19
 #import "FIRUtilities.h"
20 20
 #import "Types.h"
21
+#import "ViewController.h"
21 22
 
22 23
 @import Crashlytics;
23 24
 @import Fabric;
@@ -57,6 +58,13 @@
57 58
     return YES;
58 59
 }
59 60
 
61
+- (void) applicationWillTerminate:(UIApplication *)application {
62
+    NSLog(@"Application will terminate!");
63
+    // Try to leave the current meeting graceefully.
64
+    ViewController *rootController = (ViewController *)self.window.rootViewController;
65
+    [rootController terminate];
66
+}
67
+
60 68
 #pragma mark Linking delegate methods
61 69
 
62 70
 -    (BOOL)application:(UIApplication *)application

+ 2
- 0
ios/app/src/ViewController.h 查看文件

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

+ 7
- 0
ios/app/src/ViewController.m 查看文件

@@ -102,4 +102,11 @@
102 102
 }
103 103
 #endif
104 104
 
105
+#pragma mark - Helpers
106
+
107
+- (void)terminate {
108
+    JitsiMeetView *view = (JitsiMeetView *) self.view;
109
+    [view leave];
110
+}
111
+
105 112
 @end

Loading…
取消
儲存