feat(ios) support for destroying & reinitializing the react native bridge
This commit is contained in:
parent
efc5c9dabe
commit
af9958ad66
|
@ -59,6 +59,16 @@
|
||||||
|
|
||||||
#pragma mark - Utility methods
|
#pragma mark - Utility methods
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Once the react native bridge is destroyed you are responsible for reinstantiating it back. Use this method to do so.
|
||||||
|
*/
|
||||||
|
- (void)instantiateReactNativeBridge;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method to destroy the react native bridge, cleaning up resources in the process. Once the react native bridge is destroyed you are responsible for reinstantiating it back using `instantiateReactNativeBridge` method.
|
||||||
|
*/
|
||||||
|
- (void)destroyReactNativeBridge;
|
||||||
|
|
||||||
- (JitsiMeetConferenceOptions *_Nonnull)getInitialConferenceOptions;
|
- (JitsiMeetConferenceOptions *_Nonnull)getInitialConferenceOptions;
|
||||||
|
|
||||||
- (BOOL)isCrashReportingDisabled;
|
- (BOOL)isCrashReportingDisabled;
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
#import <RNGoogleSignin/RNGoogleSignin.h>
|
#import <RNGoogleSignin/RNGoogleSignin.h>
|
||||||
#import <WebRTC/RTCLogging.h>
|
#import <WebRTC/RTCLogging.h>
|
||||||
|
|
||||||
|
|
||||||
@implementation JitsiMeet {
|
@implementation JitsiMeet {
|
||||||
RCTBridgeWrapper *_bridgeWrapper;
|
RCTBridgeWrapper *_bridgeWrapper;
|
||||||
NSDictionary *_launchOptions;
|
NSDictionary *_launchOptions;
|
||||||
|
@ -50,7 +49,7 @@
|
||||||
|
|
||||||
- (instancetype)init {
|
- (instancetype)init {
|
||||||
if (self = [super init]) {
|
if (self = [super init]) {
|
||||||
// Initialize the on and only bridge for interfacing with React Native.
|
// Initialize the one and only bridge for interfacing with React Native.
|
||||||
_bridgeWrapper = [[RCTBridgeWrapper alloc] init];
|
_bridgeWrapper = [[RCTBridgeWrapper alloc] init];
|
||||||
|
|
||||||
// Initialize the listener for handling start/stop screensharing notifications.
|
// Initialize the listener for handling start/stop screensharing notifications.
|
||||||
|
@ -119,6 +118,18 @@
|
||||||
|
|
||||||
#pragma mark - Utility methods
|
#pragma mark - Utility methods
|
||||||
|
|
||||||
|
- (void)instantiateReactNativeBridge {
|
||||||
|
if (_bridgeWrapper != nil) {
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
|
_bridgeWrapper = [[RCTBridgeWrapper alloc] init];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)destroyReactNativeBridge {
|
||||||
|
_bridgeWrapper = nil;
|
||||||
|
}
|
||||||
|
|
||||||
- (JitsiMeetConferenceOptions *)getInitialConferenceOptions {
|
- (JitsiMeetConferenceOptions *)getInitialConferenceOptions {
|
||||||
if (_launchOptions[UIApplicationLaunchOptionsURLKey]) {
|
if (_launchOptions[UIApplicationLaunchOptionsURLKey]) {
|
||||||
NSURL *url = _launchOptions[UIApplicationLaunchOptionsURLKey];
|
NSURL *url = _launchOptions[UIApplicationLaunchOptionsURLKey];
|
||||||
|
|
Loading…
Reference in New Issue