I have written a simple Zoom Meeting SDK integration. My objective is to send and receive chat messages using my bot. If anyone sends a public message or directly sends a message to my bot then the bot should receive it, and secondly, the bot should be able to respond to such messages either publicly or privately.
I am facing a problem with both sending and receiving messages.
I implemented IMeetingChatCtrlEvent
and added it like this:
m_pChatController->SetEvent(new MeetingChatControllerEvent());
class MeetingChatControllerEvent : public IMeetingChatCtrlEvent
{
public:
MeetingChatControllerEvent();
virtual void onChatMsgNotification (IChatMsgInfo *chatMsg, const zchar_t *content);
virtual void onChatMsgNotifcation (IChatMsgInfo *chatMsg, const zchar_t *content);
virtual void onChatStatusChangedNotification (ChatStatus *status_);
virtual void onChatMsgDeleteNotification (const zchar_t *msgID, SDKChatMessageDeleteType deleteBy);
virtual void onShareMeetingChatStatusChanged (bool isStart);
virtual void onFileSendStart (ISDKFileSender *sender);
virtual void onFileReceived (ISDKFileReceiver *receiver);
virtual void onFileTransferProgress (SDKFileTransferInfo *info);
};
- I added logging and found out that the constructor gets called however
onChatMsgNotification
method does not get called. - As a matter of fact, the only other method called was
onChatStatusChangedNotification
with thestatus->is_chat_off
set as 0.
onChatMsgNotification
method should be called with the chat messages as per my expectation. Also, I noticed onChatMsgNotifcation
(notice the typo) method had to be implemented for the code to successfully compile. Weird.
Secondly, here is how I am trying to send a test message to everyone in the meeting:
std::wstring wstr = L"Hello world!";
wchar_t wcharArray[1024];
wcscpy(wcharArray, wstr.c_str());
char charArray[1024];
std::wcstombs(charArray, wcharArray, 1024);
IChatMsgInfoBuilder* chat_builder = m_pChatController->GetChatMessageBuilder();
chat_builder->SetReceiver(0);
chat_builder->SetMessageType(SDKChatMessageType_To_All);
chat_builder->SetContent(charArray);
chat_builder->Build();
m_pChatController->SendChatMsgTo(chat_builder->Build());
std::cout << "Chat message sent successfully" << std::endl;
Here, I can see the success log in the console but the bot did not actually send any message in the meeting. I was expecting the method to throw an error if it did not have the permissions or if it failed to send the message. I have given almost all the permissions related to meetings and chats to my Zoom app.
The Zoom Meeting SDK version is 6.1.0.225.
@chunsiong.zoom @gofmannir Would you be able to help here?