具有嵌入式 Web 视图的 Teams 消息传递扩展 - Web 应用程序的结构

安妮

我再次需要有关消息扩展的帮助。我想在我的消息传递扩展中显示一个自定义的 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 提供的文档有点困惑。

谢谢你的帮助!


更新:我想更详细地描述我在做什么

  • 在用户单击我的机器人中的消息扩展后,“OnTeamsMessagingExtensionFetchTaskAsyn”被调用。
  • 然后执行以下操作:

'

 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;
  • 当我在“https://xxxxxx.eu.ngrok.io/messages/messages”上调试我的网络应用程序时,我看到 MessagesController 被调用,然后想要显示相应的视图

'

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

图 1 - 浏览器开发工具显示,与网站的连接已建立 图 1 - 浏览器开发工具显示,与网站的连接已建立

图 2 - 使用开发工具我强迫团队加载 iframe 图 2 - 使用开发工具我强迫团队加载 iframe

希尔顿吉塞诺

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] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Microsoft Teams 是否具有嵌入式 Web 瀏覽器?

Java Web应用程序中的嵌入式Derby

Flutter Web 应用程序的 Web 视图

有什么方法可以从Visual Studio代码扩展的Web视图导航到外部Windows应用程序?

使用嵌入式 Tomcat 的 Web 应用程序仅适用于 IDE

在嵌入式Tomcat上从Spring-Boot Web应用程序运行Python脚本

拒绝在我的 Web 应用程序中构建嵌入式网站

基于嵌入式 linux 的 Web 应用程序设计

使用嵌入式Jetty和jersey建立Web应用程序,并进行请求分派

嵌入式Java Web服务器隐藏应用程序界面

Go Web应用程序的目录结构

大规模和完全可扩展的Web应用程序体系结构

使用requirejs扩展Web应用程序

扩展Spring Integration Web应用程序

Firebase Web应用程序的管理员视图:如何

SpringBoot Web MVC应用程序无法解析视图

实时更新树视图作为Web应用程序

Spring Web 应用程序。无法查看视图页面

如何设置Silverlight浏览器应用程序与嵌入式Web浏览器控件之间的通信

在Notes经典Web UI中启用某种Notes嵌入式视图

使用HTML作为Web应用程序开发桌面应用程序视图

为什么视图状态、会话和应用程序状态被认为对 Web 应用程序不利?

在非 Vue Web 应用程序中嵌入 Vue 应用程序(或 Vue Web 组件)

发送太多消息时,带有实时消息的Web应用程序挂起

具有独立应用程序的嵌入式Linux

交互式消息按钮未更新 Web 应用程序

骨干Web应用程序体系结构-最佳实践

单页JavaScript Web应用程序的体系结构?

Web应用程序的Go Lang文件夹结构