Browse Source

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

Fixes: https://github.com/jitsi/jitsi-meet/issues/6665
j8
Saúl Ibarra Corretgé 5 years ago
parent
commit
b7f1f3c659
3 changed files with 17 additions and 0 deletions
  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 View File

18
 #import "AppDelegate.h"
18
 #import "AppDelegate.h"
19
 #import "FIRUtilities.h"
19
 #import "FIRUtilities.h"
20
 #import "Types.h"
20
 #import "Types.h"
21
+#import "ViewController.h"
21
 
22
 
22
 @import Crashlytics;
23
 @import Crashlytics;
23
 @import Fabric;
24
 @import Fabric;
57
     return YES;
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
 #pragma mark Linking delegate methods
68
 #pragma mark Linking delegate methods
61
 
69
 
62
 -    (BOOL)application:(UIApplication *)application
70
 -    (BOOL)application:(UIApplication *)application

+ 2
- 0
ios/app/src/ViewController.h View File

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

+ 7
- 0
ios/app/src/ViewController.m View File

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

Loading…
Cancel
Save