getContextProvider

Customer Service용 옴니채널은 Dynamics 365 Customer Service Enterprise의 기능을 확장하는 기능 모음을 제공하여 조직이 디지털 메시징 채널을 통해 고객과 즉시 연결하고 참여할 수 있도록 합니다. Customer Service용 옴니채널에 액세스하려면 추가 라이선스가 필요합니다. 자세한 내용은 Dynamics 365 Customer Service 가격 책정 개요 및 Dynamics 365 Customer Service 요금제 페이지를 참조하십시오.

현재 설정된 사용자 지정 컨텍스트 공급자(있는 경우)를 검색합니다.

비고

라이브 채팅 SDK 메서드는 lcw:ready 이벤트 가 발생한 후에 호출해야 합니다. window 개체에 고유한 이벤트 수신기를 추가하여 이 이벤트를 수신할 수 있습니다.

Syntax

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 참조