編輯

共用方式為


onPresenceChange​ event (JavaScript API reference) for Dynamics 365 Channel Integration Framework 2.0

Invoked when the presence status of an agent has changed manually or programmatically.

eventData

The onPresenceChange event takes the following eventData:

eventData Example
{"presenceId": <guid>} {"presenceId": "efdeb843-c07a-e811-8162-000d3aa11f50"}
{"presenceInfo":{"basePresenceStatus":<string>, "presenceColor":<string>, "presenceId":<string>,"presenceText":<string>}} {"presenceInfo":{"basePresenceStatus: "BUSY", "presenceColor": "#ff0000", "presenceId":"efdeb843-c07a-e811-8162-000d3aa11f50", "presenceText": "Busy"}}

Example

handlerFunction = function (eventData) { 
                    var obj = JSON.parse(eventData); 
                    var presence = obj.presenceInfo.presenceText; 
                } 
                window.Microsoft.CIFramework.addHandler("onPresenceChange", handlerFunction); 

See also

setClickToAct method
addHandler method
removeHandler method
getPresence method
setPresence method