Skip to content

Commit

Permalink
Removes screen share event handling from external-api middleware and …
Browse files Browse the repository at this point in the history
…moves it into a common screen-share middleware to be used by both native and RN sdks
  • Loading branch information
rcorrie committed Jul 18, 2024
1 parent 0d5e20d commit 1115fea
Show file tree
Hide file tree
Showing 13 changed files with 135 additions and 193 deletions.
54 changes: 35 additions & 19 deletions ios/sdk/sdk.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -33,15 +33,15 @@
4E0EF63A28CA4069005D1B03 /* JMCallKitProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E0EF63728CA4069005D1B03 /* JMCallKitProxy.h */; settings = {ATTRIBUTES = (Public, ); }; };
4E0EF63B28CA4069005D1B03 /* JMCallKitProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E0EF63828CA4069005D1B03 /* JMCallKitProxy.m */; };
4E0EF63C28CA4069005D1B03 /* JMCallKitProxy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E0EF63828CA4069005D1B03 /* JMCallKitProxy.m */; };
4E51B76425E5345E0038575A /* ScheenshareEventEmiter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E51B76225E5345E0038575A /* ScheenshareEventEmiter.h */; };
4E51B76525E5345E0038575A /* ScheenshareEventEmiter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E51B76325E5345E0038575A /* ScheenshareEventEmiter.m */; };
4E51B76425E5345E0038575A /* ScreenShareEventEmitter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E51B76225E5345E0038575A /* ScreenShareEventEmitter.h */; };
4E51B76525E5345E0038575A /* ScreenShareEventEmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E51B76325E5345E0038575A /* ScreenShareEventEmitter.m */; };
4E812F3328F9A4290087ACC9 /* JitsiMeetView+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E812F3228F9A4290087ACC9 /* JitsiMeetView+Private.h */; };
4E812F3428F9A4290087ACC9 /* JitsiMeetView+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E812F3228F9A4290087ACC9 /* JitsiMeetView+Private.h */; };
4E812F3928F9A4ED0087ACC9 /* JitsiMeetView+Private.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E812F3628F9A4ED0087ACC9 /* JitsiMeetView+Private.m */; };
4E812F3A28F9A4ED0087ACC9 /* JitsiMeetView+Private.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E812F3628F9A4ED0087ACC9 /* JitsiMeetView+Private.m */; };
4ED4FFF32721B9B90074E620 /* JitsiAudioSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 4ED4FFF12721B9B90074E620 /* JitsiAudioSession.h */; settings = {ATTRIBUTES = (Public, ); }; };
4ED4FFF42721B9B90074E620 /* JitsiAudioSession.m in Sources */ = {isa = PBXBuildFile; fileRef = 4ED4FFF22721B9B90074E620 /* JitsiAudioSession.m */; };
6F08DF7D4458EE3CF3F36F6D /* BuildFile in Frameworks */ = {isa = PBXBuildFile; };
6F08DF7D4458EE3CF3F36F6D /* (null) in Frameworks */ = {isa = PBXBuildFile; };
9A8EE79C77C17743BB66E8BD /* libPods-JitsiMeetSDKLite.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B46497DE9A95BDF5E312AF48 /* libPods-JitsiMeetSDKLite.a */; };
A4A934E9212F3ADB001E9388 /* Dropbox.m in Sources */ = {isa = PBXBuildFile; fileRef = A4A934E8212F3ADB001E9388 /* Dropbox.m */; };
C6245F5D2053091D0040BE68 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = C6245F5B2053091D0040BE68 /* [email protected] */; };
Expand All @@ -66,7 +66,7 @@
DE9A0132289A9A9A00E41CBB /* RCTBridgeWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B93EF7C1EC9DDCD0030D24D /* RCTBridgeWrapper.h */; };
DE9A0133289A9A9A00E41CBB /* JitsiMeetBaseLogHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = DE81A2DC2317ED5400AE1940 /* JitsiMeetBaseLogHandler.h */; settings = {ATTRIBUTES = (Public, ); }; };
DE9A0134289A9A9A00E41CBB /* JitsiMeetSDK.h in Headers */ = {isa = PBXBuildFile; fileRef = DEA9F283258A5D9900D4CD74 /* JitsiMeetSDK.h */; settings = {ATTRIBUTES = (Public, ); }; };
DE9A0135289A9A9A00E41CBB /* ScheenshareEventEmiter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E51B76225E5345E0038575A /* ScheenshareEventEmiter.h */; };
DE9A0135289A9A9A00E41CBB /* ScreenShareEventEmitter.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E51B76225E5345E0038575A /* ScreenShareEventEmitter.h */; };
DE9A0136289A9A9A00E41CBB /* JitsiMeetBaseLogHandler+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = DE65AACB2318028300290BEC /* JitsiMeetBaseLogHandler+Private.h */; };
DE9A0138289A9A9A00E41CBB /* JitsiMeetViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B412F1B1EDEC80100B1A0A6 /* JitsiMeetViewDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
DE9A0139289A9A9A00E41CBB /* JitsiAudioSession.h in Headers */ = {isa = PBXBuildFile; fileRef = 4ED4FFF12721B9B90074E620 /* JitsiAudioSession.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -94,7 +94,7 @@
DE9A0153289A9A9A00E41CBB /* Proximity.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BCA495E1EC4B6C600B793EE /* Proximity.m */; };
DE9A0155289A9A9A00E41CBB /* ReactUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = DEFE535521FB2E8300011A3A /* ReactUtils.m */; };
DE9A0157289A9A9A00E41CBB /* DragGestureController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6A3425E204EF76800E062DD /* DragGestureController.swift */; };
DE9A0158289A9A9A00E41CBB /* ScheenshareEventEmiter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E51B76325E5345E0038575A /* ScheenshareEventEmiter.m */; };
DE9A0158289A9A9A00E41CBB /* ScreenShareEventEmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E51B76325E5345E0038575A /* ScreenShareEventEmitter.m */; };
DE9A015C289A9A9A00E41CBB /* JitsiMeetLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = DE81A2D32316AC4D00AE1940 /* JitsiMeetLogger.m */; };
DE9A015E289A9A9A00E41CBB /* JitsiMeetView.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B412F171EDEC65D00B1A0A6 /* JitsiMeetView.m */; };
DE9A015F289A9A9A00E41CBB /* JitsiMeet.m in Sources */ = {isa = PBXBuildFile; fileRef = DEFE535321FB1BF800011A3A /* JitsiMeet.m */; };
Expand Down Expand Up @@ -138,8 +138,8 @@
4E0EF63428CA317E005D1B03 /* JMCallKitListener.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JMCallKitListener.h; sourceTree = "<group>"; };
4E0EF63728CA4069005D1B03 /* JMCallKitProxy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JMCallKitProxy.h; sourceTree = "<group>"; };
4E0EF63828CA4069005D1B03 /* JMCallKitProxy.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JMCallKitProxy.m; sourceTree = "<group>"; };
4E51B76225E5345E0038575A /* ScheenshareEventEmiter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScheenshareEventEmiter.h; sourceTree = "<group>"; };
4E51B76325E5345E0038575A /* ScheenshareEventEmiter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ScheenshareEventEmiter.m; sourceTree = "<group>"; };
4E51B76225E5345E0038575A /* ScreenShareEventEmitter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ScreenShareEventEmitter.h; sourceTree = "<group>"; };
4E51B76325E5345E0038575A /* ScreenShareEventEmitter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ScreenShareEventEmitter.m; sourceTree = "<group>"; };
4E812F3228F9A4290087ACC9 /* JitsiMeetView+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "JitsiMeetView+Private.h"; sourceTree = "<group>"; };
4E812F3628F9A4ED0087ACC9 /* JitsiMeetView+Private.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "JitsiMeetView+Private.m"; sourceTree = "<group>"; };
4ED4FFF12721B9B90074E620 /* JitsiAudioSession.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JitsiAudioSession.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -195,7 +195,7 @@
files = (
0BB9AD791F5EC6D7001C08DB /* Intents.framework in Frameworks */,
0BB9AD771F5EC6CE001C08DB /* CallKit.framework in Frameworks */,
6F08DF7D4458EE3CF3F36F6D /* BuildFile in Frameworks */,
6F08DF7D4458EE3CF3F36F6D /* (null) in Frameworks */,
3453F4A32680898C4A40E821 /* libPods-JitsiMeetSDK.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -292,8 +292,8 @@
C8AFD27E2462C613000293D2 /* InfoPlistUtil.m */,
C81E9AB825AC5AD800B134D9 /* ExternalAPI.h */,
0BA13D301EE83FF8007BEF7F /* ExternalAPI.m */,
4E51B76225E5345E0038575A /* ScheenshareEventEmiter.h */,
4E51B76325E5345E0038575A /* ScheenshareEventEmiter.m */,
4E51B76225E5345E0038575A /* ScreenShareEventEmitter.h */,
4E51B76325E5345E0038575A /* ScreenShareEventEmitter.m */,
DE9A0170289A9A9A00E41CBB /* Lite-Info.plist */,
);
path = src;
Expand Down Expand Up @@ -367,7 +367,7 @@
0B93EF7E1EC9DDCD0030D24D /* RCTBridgeWrapper.h in Headers */,
DE81A2DE2317ED5400AE1940 /* JitsiMeetBaseLogHandler.h in Headers */,
DEA9F284258A5D9900D4CD74 /* JitsiMeetSDK.h in Headers */,
4E51B76425E5345E0038575A /* ScheenshareEventEmiter.h in Headers */,
4E51B76425E5345E0038575A /* ScreenShareEventEmitter.h in Headers */,
DE65AACC2318028300290BEC /* JitsiMeetBaseLogHandler+Private.h in Headers */,
0B412F221EDEF6EA00B1A0A6 /* JitsiMeetViewDelegate.h in Headers */,
4E0EF63528CA317E005D1B03 /* JMCallKitListener.h in Headers */,
Expand All @@ -393,7 +393,7 @@
DE9A0132289A9A9A00E41CBB /* RCTBridgeWrapper.h in Headers */,
DE9A0133289A9A9A00E41CBB /* JitsiMeetBaseLogHandler.h in Headers */,
DE9A0134289A9A9A00E41CBB /* JitsiMeetSDK.h in Headers */,
DE9A0135289A9A9A00E41CBB /* ScheenshareEventEmiter.h in Headers */,
DE9A0135289A9A9A00E41CBB /* ScreenShareEventEmitter.h in Headers */,
DE9A0136289A9A9A00E41CBB /* JitsiMeetBaseLogHandler+Private.h in Headers */,
DE9A0138289A9A9A00E41CBB /* JitsiMeetViewDelegate.h in Headers */,
4E0EF63628CA317E005D1B03 /* JMCallKitListener.h in Headers */,
Expand Down Expand Up @@ -678,7 +678,7 @@
4E0EF63228CA2FB3005D1B03 /* JMCallKitEmitter.m in Sources */,
DEFE535621FB2E8300011A3A /* ReactUtils.m in Sources */,
C6A34261204EF76800E062DD /* DragGestureController.swift in Sources */,
4E51B76525E5345E0038575A /* ScheenshareEventEmiter.m in Sources */,
4E51B76525E5345E0038575A /* ScreenShareEventEmitter.m in Sources */,
A4A934E9212F3ADB001E9388 /* Dropbox.m in Sources */,
DE81A2D52316AC4D00AE1940 /* JitsiMeetLogger.m in Sources */,
0B412F191EDEC65D00B1A0A6 /* JitsiMeetView.m in Sources */,
Expand Down Expand Up @@ -711,7 +711,7 @@
4E812F3A28F9A4ED0087ACC9 /* JitsiMeetView+Private.m in Sources */,
DE9A0155289A9A9A00E41CBB /* ReactUtils.m in Sources */,
DE9A0157289A9A9A00E41CBB /* DragGestureController.swift in Sources */,
DE9A0158289A9A9A00E41CBB /* ScheenshareEventEmiter.m in Sources */,
DE9A0158289A9A9A00E41CBB /* ScreenShareEventEmitter.m in Sources */,
DE9A015C289A9A9A00E41CBB /* JitsiMeetLogger.m in Sources */,
4E0EF63328CA2FB3005D1B03 /* JMCallKitEmitter.m in Sources */,
DE9A015E289A9A9A00E41CBB /* JitsiMeetView.m in Sources */,
Expand Down Expand Up @@ -873,7 +873,11 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
INFOPLIST_FILE = src/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = org.jitsi.JitsiMeetSDK.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -902,7 +906,11 @@
DYLIB_INSTALL_NAME_BASE = "@rpath";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
INFOPLIST_FILE = src/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = org.jitsi.JitsiMeetSDK.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -935,7 +943,11 @@
"JITSI_MEET_SDK_LITE=1",
);
INFOPLIST_FILE = "src/Lite-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = org.jitsi.JitsiMeetSDK.ios;
PRODUCT_NAME = JitsiMeetSDK;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -969,7 +981,11 @@
JITSI_MEET_SDK_LITE,
);
INFOPLIST_FILE = "src/Lite-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = org.jitsi.JitsiMeetSDK.ios;
PRODUCT_NAME = JitsiMeetSDK;
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
6 changes: 3 additions & 3 deletions ios/sdk/src/JitsiMeet.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#import "RCTBridgeWrapper.h"
#import "ReactUtils.h"
#import "RNSplashScreen.h"
#import "ScheenshareEventEmiter.h"
#import "ScreenShareEventEmitter.h"

#import <react-native-webrtc/WebRTCModuleOptions.h>

Expand All @@ -36,7 +36,7 @@
@implementation JitsiMeet {
RCTBridgeWrapper *_bridgeWrapper;
NSDictionary *_launchOptions;
ScheenshareEventEmiter *_screenshareEventEmiter;
ScreenShareEventEmitter *_screenShareEventEmitter;
}

#pragma mak - This class is a singleton
Expand Down Expand Up @@ -64,7 +64,7 @@ - (instancetype)init {
_bridgeWrapper = [[RCTBridgeWrapper alloc] init];

// Initialize the listener for handling start/stop screensharing notifications.
_screenshareEventEmiter = [[ScheenshareEventEmiter alloc] init];
_screenShareEventEmitter = [[ScreenShareEventEmitter alloc] init];

// Register a fatal error handler for React.
registerReactFatalErrorHandler();
Expand Down
25 changes: 0 additions & 25 deletions ios/sdk/src/ScheenshareEventEmiter.h

This file was deleted.

72 changes: 0 additions & 72 deletions ios/sdk/src/ScheenshareEventEmiter.m

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#import <Foundation/Foundation.h>

#import <React/RCTBridgeModule.h>
#import <React/RCTEventEmitter.h>

NS_ASSUME_NONNULL_BEGIN

@interface ScreenShareEventEmitter : RCTEventEmitter <RCTBridgeModule>
@end

NS_ASSUME_NONNULL_END
File renamed without changes.
12 changes: 8 additions & 4 deletions react-native-sdk/prepare_sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@ copyFolderRecursiveSync(
`${iosSrcPath}/dropbox`,
iosDestPath
);
copyFolderRecursiveSync(
`${iosSrcPath}/screen-share`,
iosDestPath
);
fs.copyFileSync(
`${iosSrcPath}/AppInfo.m`,
`${iosDestPath}/AppInfo.m`
Expand Down Expand Up @@ -166,6 +162,14 @@ fs.copyFileSync(
`${iosSrcPath}/LocaleDetector.m`,
`${iosDestPath}/LocaleDetector.m`
);
fs.copyFileSync(
`${iosSrcPath}/ScreenShareEventEmitter.m`,
`${iosDestPath}/ScreenShareEventEmitter.m`
);
fs.copyFileSync(
`${iosSrcPath}/ScreenShareEventEmitter.h`,
`${iosDestPath}/ScreenShareEventEmitter.h`
);
fs.copyFileSync(
`${iosSrcPath}/POSIX.m`,
`${iosDestPath}/POSIX.m`
Expand Down
1 change: 1 addition & 0 deletions react/features/app/middlewares.native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import '../mobile/permissions/middleware';
import '../mobile/proximity/middleware';
import '../mobile/wake-lock/middleware';
import '../mobile/react-native-sdk/middleware';
import '../mobile/screen-share/middleware';
import '../mobile/watchos/middleware';
import '../share-room/middleware';
import '../shared-video/middleware';
Expand Down
11 changes: 0 additions & 11 deletions react/features/mobile/external-api/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { AnyAction } from 'redux';
import { ENDPOINT_TEXT_MESSAGE_NAME } from '../../../../modules/API/constants';
import { appNavigate } from '../../app/actions.native';
import { IStore } from '../../app/types';
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../../base/app/actionTypes';
import {
CONFERENCE_BLURRED,
CONFERENCE_FAILED,
Expand Down Expand Up @@ -128,12 +127,6 @@ externalAPIEnabled && MiddlewareRegistry.register(store => next => action => {
const { type } = action;

switch (type) {
case APP_WILL_MOUNT:
_registerForNativeEvents(store);
break;
case APP_WILL_UNMOUNT:
_unregisterForNativeEvents();
break;
case CONFERENCE_FAILED: {
const { error, ...data } = action;

Expand Down Expand Up @@ -373,10 +366,6 @@ function _registerForNativeEvents(store: IStore) {
}
});

eventEmitter.addListener(ExternalAPI.TOGGLE_SCREEN_SHARE, ({ enabled }: any) => {
dispatch(toggleScreensharing(enabled));
});

eventEmitter.addListener(ExternalAPI.RETRIEVE_PARTICIPANTS_INFO, ({ requestId }: any) => {

const participantsInfo = [];
Expand Down
11 changes: 0 additions & 11 deletions react/features/mobile/react-native-sdk/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,3 @@ export function isExternalAPIAvailable() {

return ExternalAPI !== null;
}

/**
* Determines if the ScreenShareEventEmitter native module is available.
*
* @returns {boolean} If yes {@code true} otherwise {@code false}.
*/
export function isScreenShareAPIAvailable() {
const { ScreenShareEventEmitter } = NativeModules;

return ScreenShareEventEmitter !== null;
}
Loading

0 comments on commit 1115fea

Please sign in to comment.