我再次需要有关消息扩展的帮助。我想在我的消息传递扩展中显示一个自定义的 web 视图,就像这里https://docs.microsoft.com/en-us/microsoftteams/platform/messaging-extensions/how-to/action-commands/create-task-module ?tabs=dotnet(“带有嵌入式 Web 视图”)。我现在不明白必须如何编写 Web 应用程序以及消息扩展正在执行/调用的详细信息。所以只是输入一个普通的url是行不通的,我已经测试过了。有没有人可以解释我的 Web 应用程序需要哪种端点/结构才能被消息传递扩展成功调用?我对 MS 提供的文档有点困惑。
谢谢你的帮助!
更新:我想更详细地描述我在做什么
'
var response = new MessagingExtensionActionResponse()
{
Task = new TaskModuleContinueResponse()
{
Value = new TaskModuleTaskInfo()
{
Height = "large",
Width = "large",
Title = "Example task module",
Url = "https://xxxxxx.eu.ngrok.io/messages/messages",
},
},
};
return response;
'
public IActionResult Messages()
{
return View();
}
public MessagesController()
{
}
但是页面不显示。Teams 表示无法访问该应用程序。
更新 2
我将我的 Web 应用程序的域添加到清单中的“messageHandlers”,但它不起作用
当用户点击消息扩展时,网站没有显示
然后我尝试了另一种类型的 ActionResponse(用于配置的)并且有效
return new MessagingExtensionActionResponse
{
ComposeExtension = new MessagingExtensionResult
{
Type = "config",
SuggestedActions = new MessagingExtensionSuggestedAction
{
Actions = new List<CardAction>
{
new CardAction
{
Type = ActionTypes.OpenUrl,
Value = "https://xxxxx.eu.ngrok.io/messages/messages",
},
},
},
},
};
更新 3
I'd suggest having a look at the various samples provided for this. There are samples in the Bot Framework sample gallery (https://github.com/pnp/teams-dev-samples/tree/master/samples) and also in the Teams PnP Samples (https://github.com/pnp/teams-dev-samples/tree/master/samples). You can also look in the overall Teams Sample gallery viewer at https://pnp.github.io/teams-dev-samples/.
评论中有很多讨论,但最终showLoadingIndicator
设置被设置为true
,这也是这个问题的一个复杂因素,需要更改(或在网页中更好地处理 - 请参阅此处了解更多信息:Microsoft-团队:由于“访问此应用程序时出现问题”错误,无法测试个人选项卡)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句