我在 azure 中部署了一个 Web 应用程序,该应用程序在 Messenger Webview 中打开。我制作了一个空文本提示,供用户单击以便用户在关闭 Webview 时能够继续。然而,用户有时会忘记单击该按钮。我读过这个文档,但我无法做到这一点,因为我最好看实际的示例和代码。当用户关闭或按下 Web 视图中的按钮时,对话框如何自动继续?谢谢。
Web 视图是一组问题,用户的答案保存在 Cosmos DB 中,当用户关闭 Web 视图时,机器人会访问他们在 Cosmos DB 中的分数并计算他们的分数。
这是我当前的代码。
private static async Task<DialogTurnResult> ThirdStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken = default(CancellationToken))
{
Activity reply = stepContext.Context.Activity.CreateReply();
reply.ChannelData = JObject.FromObject(
new
{
attachment = new
{
type = "template",
payload = new
{
template_type = "generic",
elements = new[]
{
new
{
title = "<title>",
buttons = new object[]
{
new
{
type = "web_url",
title = "<title>",
url = webAppUrl,
messenger_extensions="true",
webview_height_ratio = "tall",
},
new
{
type = "postback",
title = "Done ✔️",
payload = "Done ✔️",
},
},
},
},
},
},
});
梵蒂冈之花
相关分类