共用方式為


removeContextProvider

Customer Service 全通路提供一組展現 Dynamics 365 Customer Service Enterprise 強大威力的功能套件,讓組織可以立即與不同數位傳訊管道中的客戶進行聯繫和互動。 存取 Customer Service 全通路需要額外的授權。 如需詳細資訊,請參閱 Dynamics 365 Customer Service 定價概觀Dynamics 365 Customer Service 定價方案頁面。

移除目前設定的自訂內容提供者 (如果有的話)。

備註

應該在引發 lcw:ready 事件 之後叫用即時聊天 SDK 方法。 您可以在視窗物件上新增自己的事件接聽程式,以監聽此事件。

語法

Microsoft.Omnichannel.LiveChatWidget.SDK.removeContextProvider();

參數

None

返回值

None

Example

window.addEventListener("lcw:ready", function handleLivechatReadyEvent(){
   // Set the custom context provider
   // Throws error if contextProvider is not a function
   Microsoft.Omnichannel.LiveChatWidget.SDK.setContextProvider(function contextProvider(){
      // Here it is assumed that the corresponding work stream would have context variables with logical name of 'contextKey1', 'contextKey2', 'contextKey3'.
      return {
                 'contextKey1': 'contextValue1', // string value
                 'contextKey2': 12.34, // number value
                 'contextKey3': true // boolean value
      };
   });

   // Removes the currently set custom context provider, if any
   Microsoft.Omnichannel.LiveChatWidget.SDK.removeContextProvider();
});

即時聊天 SDK 的 JavaScript API 參考