# Core features Chat is is designed to support in-session text communication. Zoom truncates messages exceeding a binary size of 10,000 bytes. As a best practice, we recommend a limit of 1000 characters per message. While in a session, users can send chat messages to each other. Two main components within the SDK help you implement in-session messaging: - An instance of `ZMVideoSDKChatHelper` provides methods to send and receive messages in a session. - The `onChatNewMessageNotify` callback from your `ZMVideoSDKDelegate` confirms the delivery of a message. For sending files and tracking transfer status, see [Send files in chat](/docs/video-sdk/macos/chat/send-files-in-chat/). For per-message metadata, see [Chat message details](/docs/video-sdk/macos/chat/chat-message-details/). ## Send a private message Users can send a message privately to a single user. ```swift // Get the ZMVideoSDKChatHelper to perform chat actions. if let chatHelper = ZMVideoSDK.shared()?.getChatHelper() { // Check if chat is enabled in this session. if chatHelper.isChatDisabled() == false, chatHelper.isPrivateChatDisabled() == false { // Send message to user. chatHelper.sendChat(to: user, content: message) } } ``` ```objectivec // Get the ZMVideoSDKChatHelper to perform chat actions. ZMVideoSDKChatHelper *chatHelper = [[ZMVideoSDK sharedVideoSDK] getChatHelper]; // Check if chat is enabled in this session. if ([chatHelper IsChatDisabled] == NO && [chatHelper IsPrivateChatDisabled] == NO) { // Send message to user. [chatHelper SendChatToUser:user Content:message]; } ``` ## Send a public message Users can send a message publicly to all users in the session. ```swift // Get the ZMVideoSDKChatHelper to perform chat actions. if let chatHelper = ZMVideoSDK.shared()?.getChatHelper() { // Check if chat is enabled in this session. if chatHelper.isChatDisabled() == false { // Send message to all users in this session. chatHelper.sendChat(toAll: message) } } ``` ```objectivec // Get the ZMVideoSDKChatHelper to perform chat actions. ZMVideoSDKChatHelper *chatHelper = [[ZMVideoSDK sharedVideoSDK] getChatHelper]; // Check if chat is enabled in this session. if ([chatHelper IsChatDisabled] == NO) { // Send message to all users in this session. [chatHelper SendChatToAll:message]; } ``` ## Receive incoming messages To be notified when a message is received, use `onChatNewMessageNotify` within `ZMVideoSDKDelegate`. The `chatMessage` parameter contains information about the message, including a `ZMVideoSDKUser` info object for both the sender and recipient (if applicable). ```swift func onChatNewMessageNotify(_ helper: ZMVideoSDKChatHelper!, message chatMessage: ZMVideoSDKChatMessage!) { // Message contains the info about a chat message. if let content = chatMessage.content, let senderName = chatMessage.sendUser.getName() { print("\(senderName) sent a message: \(content)") } } ``` ```objectivec - (void)onChatNewMessageNotify:(ZMVideoSDKChatHelper *)helper message:(ZMVideoSDKChatMessage *)chatMessage { // Message contains the info about a chat message. NSString *content = chatMessage.content; ZMVideoSDKUser *sender = chatMessage.sendUser; NSLog(@"%@ sent a message: %@", [sender getName], content); } ``` For more information on how to use the `ZMVideoSDKUser` object, see [Sessions](/docs/video-sdk/macos/sessions/).