clear window in bot v4 - botframework

I want to clear bot window once user logged out. I used below code in js
//used class to remove all elements
Array.from(document.getElementsByClassName("wc-message-wrapper"))
.forEach(element => element.remove());
and it worked but after this I am unable to render chat again without refreshing the page. I want to send welcome message automatically after clearing window.

Related

Android stock SMS App preview doing prefetching of a link embedded in a text message before the user clicks on it?

Another hair-pulling exercise. I am generating a link in a text message and when the user clicks on it then it would call the page, and take some action. Simple! But in the stock Android messages app (and perhaps others) it would appear that as soon as the message comes in it opens the link (effectively clicks on it like a user would = does a preview fetch?) even before there is an alert to the user. When the user then clicks on the link it is called a second time but that fails because the first call set a flag in a DB that the second call trips over. Is there some mechanism to programmatically thwart previews? Or detect that it is a preview?

Unable to connect Web App Bot to Cortana Channel

I'm trying to add the Cortana channel to a bot I've been working on today. However, when the page loads, the entire form is greyed out except for the knowledge.store Register button, and the Cancel button.
I've read elsewhere that people have managed to get past this by clicking really quickly on the Save button that appears briefly as the page loads, but I've had no luck with that. The (very helpful) tech support guy suggests it could be due to special characters or numbers in the bot name, but I have the exact same issue with a bot name that's just lowercase letters.
UPDATE: I can now see my knowledge.store organisations in a dropdown next to the Register button. Clicking the Register button throws a "Failed to create bot module" error. I am able to connect the channel successfully on another bot I made to test the issue.

Chat history Persistence in MicroSoft Botframework WebChat window

I have a requirement of maintaining chat history and loading them back in a window after a page refresh or close and opening of the window.
ISSUE : Buttons/carousel/Adaptive cards/Hero Cards events/ properties are not loading (ie; when I click on button or any event, actions are not happening).
DESCRIPTION:
In order to achieve the requirement i had 2 options.
BotFramework _ Directline JS
I guess using this we can only get conversation history and where we couldn't load back the conversation history in chat window.
Though we can get the conversation history we have to send all the messages to bot again.
So i had opted 2nd one.
Store the html controls and Load it in the bot div: When sending or receiving message action is happening from bot am storing the html controls(i.e; controls under wc-message-groups class in local storage) and binding back to the div on page load if data exists.
This works for me to show conversation history in a chat window. But I am not able to get the events/actions for buttons.
Can we do this with Directline JS or is there any option to load properties/events to controls?
Please help me with this issue.
Thanks in Advance
I would start by taking a look at this thread out the Webchat GitHub repo. There is a good discussion going on about how this may be accomplished.
I also created this project in C# using webchat which will provide chat history in the webchat control. The project uses this pull request branch which you would also need to use. Hope this helps, good luck.

FineUploader On Leave Handling

We are developing a Single Page Application in which we have hash based routing, FineUploader seems to have a functionality where when the user clicks the Browser Back the Upload is canceled, how can we use it on navigation inside our app...
Fine Uploader does not cancel an in-progress upload when the user navigates away from the current page. Quite the contrary - it prevents the uploader from being accidentally canceled by popping up a confirm dialog. If you would like to cancel all uploads at any time, you can do so via the cancelAll API method.

Insert into backstack wp7

I have an application with the following pages:
Login
Menu
Chat
when I start the application the order of the pages is the following Login -> Menu -> Chat
But... when my application is not running and I get a push notification I want to navigate the user directly to the chat window(and do the login in the background, without the login page). My problem comes at this point, because when I press back I would like to go to the menu page, and when pressing back again I want to go to the login page.
I dont want to navigate the user through the login and menu page before going to chat if he clicks a push notification.
Any suggestions?
One solution I can think of would be that you remenmber you came to the Chat page from a push notification. Then when Back key is pressed on the Chat page you you catch the event (OnBackKeyPress) and call NavigationContext.NavigateTo(MainPage) by yourself. You can do the same same on the Menu page.

Resources