Przeglądaj źródła

[iOS] Fix loading initial URL when app is closed

We must not pass nil as the URL, that will translate to null and we won't be
able to load the initial URL which is passed as the launch parameters.
j8
Saúl Ibarra Corretgé 8 lat temu
rodzic
commit
aaf5dd75fa
1 zmienionych plików z 10 dodań i 5 usunięć
  1. 10
    5
      ios/sdk/src/JitsiMeetView.m

+ 10
- 5
ios/sdk/src/JitsiMeetView.m Wyświetl plik

@@ -208,11 +208,16 @@ static NSMapTable<NSString *, JitsiMeetView *> *views;
208 208
  * @param urlObject - The URL to load which may identify a conference to join.
209 209
  */
210 210
 - (void)loadURLObject:(NSDictionary *)urlObject {
211
-    NSDictionary *props = @{
212
-        @"externalAPIScope": externalAPIScope,
213
-        @"url": urlObject ?: [NSNull null],
214
-        @"welcomePageEnabled": @(self.welcomePageEnabled)
215
-    };
211
+    NSMutableDictionary *props = [[NSMutableDictionary alloc] init];
212
+
213
+    [props setObject:externalAPIScope forKey:@"externalAPIScope"];
214
+    [props setObject:@(self.welcomePageEnabled) forKey:@"welcomePageEnabled"];
215
+
216
+    // XXX url must not be set when nil, so it appears as undefined in JS and we
217
+    // check the launch parameters.
218
+    if (urlObject) {
219
+        [props setObject:urlObject forKey:@"url"];
220
+    }
216 221
 
217 222
     if (rootView == nil) {
218 223
         rootView

Ładowanie…
Anuluj
Zapisz