Web Chat did not display the result

只愿长相守 提交于 2021-01-29 09:13:08

问题


Currently, I had developed Microsoft Graph ChatBot which retrieves the data from SharePoint but when I debug in Emulator its work, but I deploy in WebChat the result did not display.

The results from Emulator,

The results from WebChat

Anyone know how to solve it or suggestion?


回答1:


There are currently two versions of Web Chat: Gemini and Scorpio. Test in Web Chat is still using the older version - Scorpio - which unfortunately does not support OAuth Cards. The BotFramework Development Team is working to update Test in Web Chat, but if you need an immediate fix, I would recommend creating your own web page that uses the latest version of Web Chat. Take a look at the sample code below.

<!DOCTYPE html>
<html lang="en-US">
<head>
  <title>WebChat</title>
  <script src="https://cdn.botframework.com/botframework-webchat/master/webchat.js"></script>
  <style>
    html, body { height: 100% }
    body { 
      margin: 0;
      }

    #webchat {
      height: 100%;
    }

  </style>
</head>
<body>

  <div id="webchat" role="main"></div>

  <script>

    (async function() {

      // Note, for the simplicity of this example, we are simply using the Web Chat Secret here;
      // however, it is recommended that you create a backend REST API to generate and manage 
      // tokens for production.

      window.WebChat.renderWebChat({
        directLine: window.WebChat.createDirectLine({ secret: '<WEB_CHAT_SECRET>'}),
      }, document.getElementById('webchat'));

    })().catch(err => console.log(err));

  </script>
</body>

For more examples of how to get started with Web Chat, take a look at the Web Chat samples.

Hope this helps!



来源:https://stackoverflow.com/questions/56648170/web-chat-did-not-display-the-result

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!