getContextProvider

'‏‫ריבוי ערוצים‬ לשירות לקוחות' מציע חבילת יכולות המרחיבות את העוצמה של Dynamics 365 Customer Service Enterprise כדי לאפשר לארגונים להתחבר באופן מיידי ולתקשר עם הלקוחות שלהם באמצעות ערוצים להעברת הודעות דיגיטליות. נדרש רישיון נוסף כדי לגשת ל'ריבוי ערוצים עבור Customer Service'. למידע נוסף, עיין בדפים סקירת מחירי Dynamics 365 Customer Service ותוכנית המחירים של Dynamics 365 Customer Service.

מאחזר את ספק ההקשר המותאם אישית שהוגדר כעת, אם קיים.

הערה

יש להפעיל את שיטות ה-SDK של הצ'אט החי לאחר העלאת האירוע lcw:ready . אתה יכול להאזין לאירוע זה על ידי הוספת מאזין אירוע משלך לאובייקט החלון.

תחביר

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

פרמטרים

ללא

ערך החזרה

החזרת ספק ההקשר המותאם אישית שהוגדר כעת, אם קיים. אם אין ספק הקשר מותאם אישית רשום, הוא מחזיר null.

דוגמה

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

-->

הפניה ל- API של JavaScript עבור SDK של צ'אט חי