Information about the current state of the badge in the native client sidebar
Readonly
sidebar:callThis event is fired when a call information changes.
This can be anything from a new incoming call to a call that got ended
const app = new webex.Application();
app.onReady().then(() => {
app.listen()
.then(() => {
app.on("sidebar:callStateChanged", (call) => {
console.log("Call state changed. New call object:", call);
})
})
.catch((reason) => {
console.error("listen: fail reason=" + webex.Application.ErrorCodes[reason]);
});
});
This API can be used when one wants to clear the current badge shown in the native client applications
const app = new webex.Application();
await app.onReady();
const sidebar = await app.getSidebar();
const isBadgeSet = await sidebar.clearBadge();
This method returns a list of all calls from the native client.
This API can also reject with one of the following error codes.
0 = SUCCESS, 1 = GENERIC_ERROR, 5 = BAD_CONTEXT, 6 = NOT_SUPPORTED
const app = new webex.Application();
await app.onReady();
const sidebar = await app.getSidebar();
const calls = await sidebar.getCalls();
The calls
object will have a list of call objects where each call object would have properties as mentioned in ICall
This method is used to update the badge that'll be shown in the native client applications
Example for badgeType - Count
const app = new webex.Application();
await app.onReady();
const sidebar = await app.getSidebar();
const isBadgeSet = await sidebar.showBadge({
badgeType: 'count',
count: 100
});
Example for badgeType - Error
const app = new webex.Application();
await app.onReady();
const sidebar = await app.getSidebar();
const isBadgeSet = await sidebar.showBadge({
badgeType: 'error',
});
The variable isBadgeSet
is a boolean
Webex Embedded Apps Sidebar
Example
This can be accessed as follows,
The
sidebar
object's properties are documented on this page below