diff --git a/packages/uikit-react-native/src/components/MessageRenderer/UserMessage/index.tsx b/packages/uikit-react-native/src/components/MessageRenderer/UserMessage/index.tsx
index e0345e012..9272c5918 100644
--- a/packages/uikit-react-native/src/components/MessageRenderer/UserMessage/index.tsx
+++ b/packages/uikit-react-native/src/components/MessageRenderer/UserMessage/index.tsx
@@ -2,6 +2,7 @@ import React from 'react';
import type { SendbirdUserMessage } from '@sendbird/uikit-utils';
+import { useSendbirdChat } from '../../../hooks/useContext';
import type { MessageRendererInterface } from '../index';
import BaseUserMessage from './BaseUserMessage';
import OpenGraphUserMessage from './OpenGraphUserMessage';
@@ -15,7 +16,8 @@ export type UserMessageProps = MessageRendererInterface<
>;
const UserMessage = (props: UserMessageProps) => {
- if (props.message.ogMetaData) {
+ const { features } = useSendbirdChat();
+ if (props.message.ogMetaData && features.groupChannelOGTagEnabled) {
return ;
}
return ;
diff --git a/packages/uikit-react-native/src/components/OpenChannelMessageRenderer/index.tsx b/packages/uikit-react-native/src/components/OpenChannelMessageRenderer/index.tsx
index bdb0d238c..dcdf32805 100644
--- a/packages/uikit-react-native/src/components/OpenChannelMessageRenderer/index.tsx
+++ b/packages/uikit-react-native/src/components/OpenChannelMessageRenderer/index.tsx
@@ -12,7 +12,7 @@ import {
} from '@sendbird/uikit-utils';
import type { OpenChannelProps } from '../../domain/openChannel/types';
-import { useLocalization, usePlatformService } from '../../hooks/useContext';
+import { useLocalization, usePlatformService, useSendbirdChat } from '../../hooks/useContext';
import SBUUtils from '../../libs/SBUUtils';
import OpenChannelMessageDateSeparator from './OpenChannelMessageDateSeparator';
@@ -26,6 +26,7 @@ const OpenChannelMessageRenderer: OpenChannelProps['Fragment']['renderMessage']
prevMessage,
nextMessage,
}) => {
+ const { features } = useSendbirdChat();
const { STRINGS } = useLocalization();
const { mediaService } = usePlatformService();
const { groupWithPrev } = calcMessageGrouping(Boolean(enableMessageGrouping), message, prevMessage, nextMessage);
@@ -55,7 +56,11 @@ const OpenChannelMessageRenderer: OpenChannelProps['Fragment']['renderMessage']
return ;
}
case 'user.opengraph': {
- return ;
+ if (features.openChannelOGTagEnabled) {
+ return ;
+ } else {
+ return ;
+ }
}
case 'file':
case 'file.audio': {
diff --git a/packages/uikit-react-native/src/containers/SendbirdUIKitContainer.tsx b/packages/uikit-react-native/src/containers/SendbirdUIKitContainer.tsx
index 32fc533ea..975cc674d 100644
--- a/packages/uikit-react-native/src/containers/SendbirdUIKitContainer.tsx
+++ b/packages/uikit-react-native/src/containers/SendbirdUIKitContainer.tsx
@@ -61,6 +61,8 @@ export const SendbirdUIKit = Object.freeze({
USER_MENTION: false,
IMAGE_COMPRESSION: true,
MESSAGE_SEARCH: false,
+ GROUP_CHANNEL_OG_TAG: true,
+ OPEN_CHANNEL_OG_TAG: true,
},
});
@@ -208,6 +210,8 @@ const SendbirdUIKitContainer = ({
enableUserMention={chatOptions?.enableUserMention ?? SendbirdUIKit.DEFAULT.USER_MENTION}
enableImageCompression={chatOptions?.enableImageCompression ?? SendbirdUIKit.DEFAULT.IMAGE_COMPRESSION}
enableMessageSearch={chatOptions?.enableMessageSearch ?? SendbirdUIKit.DEFAULT.MESSAGE_SEARCH}
+ enableGroupChannelOGTag={chatOptions?.enableGroupChannelOGTag ?? SendbirdUIKit.DEFAULT.GROUP_CHANNEL_OG_TAG}
+ enableOpenChannelOGTag={chatOptions?.enableOpenChannelOGTag ?? SendbirdUIKit.DEFAULT.OPEN_CHANNEL_OG_TAG}
>
{
const [currentUser, _setCurrentUser] = useState();
const forceUpdate = useForceUpdate();
@@ -153,6 +159,8 @@ export const SendbirdChatProvider = ({
userMentionEnabled: enableUserMention,
imageCompressionEnabled: enableImageCompression,
messageSearchEnabled: enableMessageSearch,
+ groupChannelOGTagEnabled: enableGroupChannelOGTag,
+ openChannelOGTagEnabled: enableOpenChannelOGTag,
},
};