简体   繁体   中英

proactive message sending in MS Teams Bot not working

I created a Bot and added to Skype and Microsoft Teams. Both are responding fine for user messages (reply to user messages).

Following the documentation , I tried to send (ad-hock) proactive messages to users. This worked with Skype but it not with Microsoft Teams. It also did not provide any error messages.

Do I have to adjust any settings in Microsoft Teams or Office 365 in order to send proactive messages? Or is there any other specific way to send proactive messages for Microsoft Teams?

Figured out what was the error. Following code line should be added before calling SendToConversationAsync, CreateConversationAsync etc..

MicrosoftAppCredentials.TrustServiceUrl(ServiceUrl);

And I tested this for documentation and sample source . Both are working fine.

The documentation for this is found in this article: Starting a 1:1 conversation . There's also some sample source although it's part of a larger project.

See if that helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM