From ef9f9bf881b492c5fdc4e350580b3e8b36a816ca Mon Sep 17 00:00:00 2001 From: David Lang Date: Thu, 11 Dec 2025 11:25:45 +0100 Subject: [PATCH] feat: add option to configure display name of ios screen broadcast extension --- internal/fishjam-chat/app.json | 3 ++- .../plugin/broadcastExtensionFiles/Info.plist | 2 +- packages/react-native-client/plugin/src/types.ts | 1 + .../react-native-client/plugin/src/withFishjamIos.ts | 12 ++++++++++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/internal/fishjam-chat/app.json b/internal/fishjam-chat/app.json index c2c7cca70..ca0a77e37 100644 --- a/internal/fishjam-chat/app.json +++ b/internal/fishjam-chat/app.json @@ -68,7 +68,8 @@ "ios": { "enableScreensharing": true, "enableVoIPBackgroundMode": true, - "supportsPictureInPicture": true + "supportsPictureInPicture": true, + "broadcastExtensionDisplayName": "Fishjam Screen Broadcast" } } ], diff --git a/packages/react-native-client/plugin/broadcastExtensionFiles/Info.plist b/packages/react-native-client/plugin/broadcastExtensionFiles/Info.plist index 19b3d67ab..2afbf2ecf 100644 --- a/packages/react-native-client/plugin/broadcastExtensionFiles/Info.plist +++ b/packages/react-native-client/plugin/broadcastExtensionFiles/Info.plist @@ -3,7 +3,7 @@ CFBundleDisplayName - FishjamScreenBroadcast + {{DISPLAY_NAME}} CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier diff --git a/packages/react-native-client/plugin/src/types.ts b/packages/react-native-client/plugin/src/types.ts index adb207f68..c621f719e 100644 --- a/packages/react-native-client/plugin/src/types.ts +++ b/packages/react-native-client/plugin/src/types.ts @@ -12,6 +12,7 @@ export type FishjamPluginOptions = appGroupContainerId?: string; mainTargetName?: string; broadcastExtensionTargetName?: string; + broadcastExtensionDisplayName?: string; }; } | undefined; diff --git a/packages/react-native-client/plugin/src/withFishjamIos.ts b/packages/react-native-client/plugin/src/withFishjamIos.ts index 9126c95d7..c84f25b4b 100644 --- a/packages/react-native-client/plugin/src/withFishjamIos.ts +++ b/packages/react-native-client/plugin/src/withFishjamIos.ts @@ -17,6 +17,10 @@ function getSbeTargetName(props: FishjamPluginOptions) { ); } +function getSbeDisplayName(props: FishjamPluginOptions) { + return props?.ios?.broadcastExtensionDisplayName || 'FishjamScreenBroadcast'; +} + export function getSbePodfileSnippet(props: FishjamPluginOptions) { const targetName = getSbeTargetName(props); return `\ntarget '${targetName}' do\n pod 'FishjamCloudBroadcastClient'\nend`; @@ -26,6 +30,7 @@ const TARGETED_DEVICE_FAMILY = `"1,2"`; const IPHONEOS_DEPLOYMENT_TARGET = '15.1'; const GROUP_IDENTIFIER_TEMPLATE_REGEX = /{{GROUP_IDENTIFIER}}/gm; const BUNDLE_IDENTIFIER_TEMPLATE_REGEX = /{{BUNDLE_IDENTIFIER}}/gm; +const DISPLAY_NAME_TEMPLATE_REGEX = /{{DISPLAY_NAME}}/gm; /** * A helper function for updating a value in a file for given regex @@ -249,6 +254,13 @@ const withFishjamSBE: ConfigPlugin = (config, options) => bundleIdentifier || '', options, ); + await updateFileWithRegex( + iosPath, + 'Info.plist', + DISPLAY_NAME_TEMPLATE_REGEX, + getSbeDisplayName(options), + options, + ); // Create new PBXGroup for the extension const extGroup = xcodeProject.addPbxGroup(