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: add ability to control deep / universal linking

Saúl Ibarra Corretgéf3abca6462ad
diff --git a/ios/app/src/AppDelegate.m b/ios/app/src/AppDelegate.m
index d263cb0ae2..ee0b3c77cb 100644
--- a/ios/app/src/AppDelegate.m
+++ b/ios/app/src/AppDelegate.m
@@ -37,9 +37,10 @@
[Fabric with:@[[Crashlytics class]]];
}
- // Set the conference activity type defined in this application.
- // This cannot be defined by the SDK.
[JitsiMeet sharedInstance].conferenceActivityType = JitsiMeetConferenceActivityType;
+ [JitsiMeet sharedInstance].customUrlScheme = @"org.jitsi.meet";
+ [JitsiMeet sharedInstance].universalLinkDomains = @[@"meet.jit.si", @"beta.meet.jit.si"];
+
[[JitsiMeet sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
return YES;
diff --git a/ios/sdk/src/JitsiMeet.h b/ios/sdk/src/JitsiMeet.h
index a31670967f..447d392d61 100644
--- a/ios/sdk/src/JitsiMeet.h
+++ b/ios/sdk/src/JitsiMeet.h
@@ -18,9 +18,12 @@
#import <JitsiMeet/JitsiMeetView.h>
#import <JitsiMeet/JitsiMeetViewDelegate.h>
+
@interface JitsiMeet : NSObject
@property (copy, nonatomic, nullable) NSString *conferenceActivityType;
+@property (copy, nonatomic, nullable) NSString *customUrlScheme;
+@property (copy, nonatomic, nullable) NSArray<NSString *> *universalLinkDomains;
#pragma mak - This class is a singleton
diff --git a/ios/sdk/src/JitsiMeet.m b/ios/sdk/src/JitsiMeet.m
index 69761e0a9d..034b00c2b1 100644
--- a/ios/sdk/src/JitsiMeet.m
+++ b/ios/sdk/src/JitsiMeet.m
@@ -91,6 +91,10 @@
return YES;
}
+ if (![_customUrlScheme isEqualToString:url.scheme]) {
+ return NO;
+ }
+
return [JitsiMeetView loadURLInViews:@{ @"url" : url.absoluteString }];
}
@@ -118,7 +122,10 @@
if ([activityType isEqualToString:NSUserActivityTypeBrowsingWeb]) {
// App was started by opening a URL in the browser
- return @{ @"url" : userActivity.webpageURL.absoluteString };
+ NSURL *url = userActivity.webpageURL;
+ if ([_universalLinkDomains containsObject:url.host]) {
+ return @{ @"url" : url.absoluteString };
+ }
} else if ([activityType isEqualToString:@"INStartAudioCallIntent"]
|| [activityType isEqualToString:@"INStartVideoCallIntent"]) {
// App was started by a CallKit Intent
@@ -152,6 +159,16 @@
return nil;
}
+#pragma mark - Property getter / setters
+
+- (NSString *)customUrlScheme {
+ return _customUrlScheme ? _customUrlScheme : @"org.jitsi.meet";
+}
+
+- (NSArray<NSString *> *)universalLinkDomains {
+ return _universalLinkDomains ? _universalLinkDomains : @[@"meet.jit.si"];
+}
+
#pragma mark - Private API methods
- (RCTBridge *)getReactBridge {