Skip to content

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

feat(ios/sdk): add react native lifecycle methods

Calin-Teodorc8863b1d236c
diff --git a/ios/sdk/src/JitsiMeet.h b/ios/sdk/src/JitsiMeet.h
index 3f79001d79..ffdd391967 100644
--- a/ios/sdk/src/JitsiMeet.h
+++ b/ios/sdk/src/JitsiMeet.h
@@ -86,6 +86,10 @@ typedef NS_ENUM(NSInteger, WebRTCLoggingSeverity) {
#pragma mark - Utility methods
+- (void)instantiateReactNative;
+
+- (void)destroyReactNative;
+
- (JitsiMeetConferenceOptions *_Nonnull)getInitialConferenceOptions;
- (BOOL)isCrashReportingDisabled;
diff --git a/ios/sdk/src/JitsiMeet.m b/ios/sdk/src/JitsiMeet.m
index eab930ea52..f79020d7cf 100644
--- a/ios/sdk/src/JitsiMeet.m
+++ b/ios/sdk/src/JitsiMeet.m
@@ -157,7 +157,23 @@
options.audioDevice = _rtcAudioDevice;
options.loggingSeverity = (RTCLoggingSeverity)_webRtcLoggingSeverity;
}
-
+
+- (void)instantiateReactNative {
+ if (_reactNativeFactory == nil) {
+ [self createReactNativeFactory];
+ }
+
+ // Eagerly initialize the React host, so the JS runtime is ready before the first view is created.
+ [_reactNativeFactory.rootViewFactory initializeReactHostWithLaunchOptions:nil
+ bundleConfiguration:_reactNativeFactory.bundleConfiguration
+ devMenuConfiguration:_reactNativeFactory.devMenuConfiguration];
+}
+
+- (void)destroyReactNative {
+ _reactNativeFactory = nil;
+ _reactFactoryDelegate = nil;
+}
+
- (JitsiMeetConferenceOptions *)getInitialConferenceOptions {
if (_launchOptions[UIApplicationLaunchOptionsURLKey]) {
NSURL *url = _launchOptions[UIApplicationLaunchOptionsURLKey];