getContextProvider (getContextプロバイダ)

Customer Service 用オムニチャネルには、Dynamics 365 Customer Service Enterprise の機能を拡張する一連の機能が用意されていて、組織はデジタル メッセージング チャネルを通して顧客と即座につながり、やり取りできるようになります。 Customer Service 用オムニチャネルにアクセスする際は、追加のライセンスが必要です。 詳細については、Dynamics 365 Customer Service 価格の概要 と Dynamics 365 Customer Service 価格プラン ページを参照してください。

現在設定されているカスタム コンテキスト プロバイダー (存在する場合) を取得します。

注

ライブ チャット SDK メソッドは、 lcw:ready イベント が発生した後に呼び出す必要があります。 このイベントをリッスンするには、ウィンドウオブジェクトに独自のイベントリスナーを追加します。

構文

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

パラメーター

None

戻り値

現在設定されているカスタム コンテキスト プロバイダー (存在する場合) を返します。 登録されているカスタム コンテキスト プロバイダーがない場合は、null を返します。

Example

window.addEventListener("lcw:ready", function handleLivechatReadyEvent(){
   // Setting 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
      };
   });

   // Retrieves the currently set custom context provider
   // If there is no registered custom context provider, then it returns null
   let registeredContextProvider = Microsoft.Omnichannel.LiveChatWidget.SDK.getContextProvider();
});

-->

ライブチャットSDKのJavaScript APIリファレンス