getContextProvider

تعرض القناة متعددة الاتجاهات لـ 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();

Parameters

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();
});

-->

مرجع واجهة برمجة تطبيقات JavaScript لحزمة تطوير البرامج (SDK) للدردشة المباشرة