@microsoft/omnichannel-chat-sdk
Advanced tools
Comparing version 1.10.5 to 1.10.6-main.348dce2
{ | ||
"name": "@microsoft/omnichannel-chat-sdk", | ||
"version": "1.10.5", | ||
"version": "1.10.6-main.348dce2", | ||
"description": "Microsoft Omnichannel Chat SDK", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -56,2 +56,3 @@ # Omnichannel Chat SDK 💬 | ||
- [Chat Reconnect with Unauthenticated User](#chat-reconnect-with-unauthenticated-user) | ||
- [Handling chat Disconnect on Mobile platform](#handling-chat-disconnect-on-mobile-platform) | ||
- [Operating Hours](#operating-hours) | ||
@@ -778,2 +779,25 @@ - [Single Sign-on for Bots](/docs/scenarios/SINGLE_SIGN_ON_FOR_BOTS.md) | ||
### Handling chat Disconnect on Mobile platform | ||
> On mobile platforms, where users often switch the app between foreground and background, it is important to verify if the chat is still active before allowing the user to send a message after returning from the background . | ||
```ts | ||
// 1. Register a listener for visbilitychange event | ||
window.addEventListener("visibilitychange", async () => { | ||
// 2. verify if the browser is in the foreground by checking the document.hidden property | ||
if (!document.hidden) { | ||
//3. Check conversation state by making a call to getConversationDetails | ||
const optionalParams = { | ||
liveChatContext: {}, // EXISTING chat context data | ||
}; | ||
const conversationDetails = await chatSDK.getConversationDetails(optionalParams); | ||
if (conversationDetails?.state === "WrapUp" || conversationDetails?.state === "Closed") { | ||
//4. Show disconnect notification to customer and disable the input box so that user cannot send a message | ||
} | ||
} | ||
}); | ||
``` | ||
### Using [BotFramework-WebChat](https://github.com/microsoft/BotFramework-WebChat) | ||
@@ -780,0 +804,0 @@ > :warning: Currently supported on web only |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1079073
1020
1