问题
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