End Chat
End the conversation when the user is done with it, or when they sign out of your app
Task {
await KindlyWebViewSDK.endChat()
}The chat screen is dismissed, the conversation ends and the SDK stays started, so the next display starts a new conversation with a fresh greeting. With a chat page loaded, the SDK tells the Kindly backend that the user left. Without one, it deletes the stored conversation without telling the backend, and that session expires on its own. Before start the call does nothing
Ending the chat from inside the chat does the same. To stop the SDK as well, see Kill SDK
Stored conversation
The chat keeps its conversation in your app's web view storage (the default WebKit website data store on iOS, the WebView storage on Android), as the web chat does in a browser, so it survives app restarts and continues on the next display. It is stored for the origin chat.kindlycdn.com, per bot and market, and includes the chat's session token and chat id. Any other web view in your app that loads chat.kindlycdn.com shares this storage
endChat and kill delete the conversation of the current bot and market, so call one of them when a user signs out of your app. The widget's browser id, kindly-chat-browser-id, belongs to no bot or market and stays