Webex Embedded Apps Sidebar

Example

This can be accessed as follows,

const app = new webex.Application();
await app.onReady();
const sidebar = await app.context.getSidebar();

The sidebar object's properties are documented on this page below

Hierarchy

  • IWebexAppsSidebar

Properties

badge: IBadge

Information about the current state of the badge in the native client sidebar

Events

sidebar:callStateChanged: ICall

This event is fired when a call information changes.

This can be anything from a new incoming call to a call that got ended

Example

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

Methods

  • This API can be used when one wants to clear the current badge shown in the native client applications

    Example

    const app = new webex.Application();
    await app.onReady();
    const sidebar = await app.getSidebar();
    const isBadgeSet = await sidebar.clearBadge();

    Returns Promise<void>

  • 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

    Example

    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

    Returns Promise<ICalls>

  • This method is used to update the badge that'll be shown in the native client applications

    Example

    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

    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

    Parameters

    Returns Promise<boolean>