Class finesse.containerservices.PopoverService
Finesse Voice component and Gadget(s) hosting digital services require
the finesse.containerservices.PopoverService to display a popup
for incoming call and chat events.
This API provides makes use of the schema as defined in finesse.containerservices.PopoverSchema
and provides various operations for managing the popup.
Defined in: finesse.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Field Attributes | Field Name and Description |
---|---|
ENUM: Determines how the time in popover should update.
|
Method Attributes | Method Name and Description |
---|---|
dismissPopover(popoverId)
Dismisses the notification popover.
|
|
generatePayload(isExistingPopover, popoverId, bannerData, timerData, actionData)
Combines multiple parameters and generates a single payload for use by the popover service.
|
|
init(ContainerService)
Initialize the PopoverService for use in gadget.
|
|
showPopover(bannerData, timerData, actionData, actionHandler)
Display a popover with the given data.
|
|
updatePopover(popoverId, bannerData, timerData, actionData, actionHandler)
Modify an active popover's displayed content.
|
Class Detail
finesse.containerservices.PopoverService()
Example demonstrating initializationcontainerServices = finesse.containerservices.ContainerServices.init(); popoverService = finesse.containerservices.PopoverService.init(containerServices); popoverService.showPopover(bannerData, timerData, actionData, actionHandler);Details of the parameters are described in this API spec below.
Field Detail
COUNTER_TYPE
ENUM: Determines how the time in popover should update.
[COUNT_UP, COUNT_DOWN]
Method Detail
dismissPopover(popoverId)
Dismisses the notification popover.
- Parameters:
- {String} popoverId
- The unique identifier for the popover. This id was returned from showPopover call.
- Throws:
- Throws error if the service is not yet initialized.
generatePayload(isExistingPopover, popoverId, bannerData, timerData, actionData)
Combines multiple parameters and generates a single payload for use by the popover service.
- Parameters:
- {Boolean} isExistingPopover
- True if this popover already exists. False if not.
- {String} popoverId
- The unique identifier for the popover. This id was returned from showPopover call.
- {Object} bannerData
- Refer finesse.containerservices.PopoverSchema#getBannerDataSchema for description about this JSON payload
- {Object} timerData
- Refer finesse.containerservices.PopoverSchema#getTimerDataSchema for description about this JSON payload
- {Object} actionData
- Refer finesse.containerservices.PopoverSchema#getActionDataSchema for description about this JSON payload
- Throws:
- Throws error when the passed in popoverData is not as per defined format.
{finesse.containerservices.PopoverService}
init(ContainerService)
Initialize the PopoverService for use in gadget.
See example in Class Detail for initialization.
- Parameters:
- {finesse.containerservices.ContainerServices} ContainerService
- instance.
- Returns:
- {finesse.containerservices.PopoverService} instance.
{String}
showPopover(bannerData, timerData, actionData, actionHandler)
Display a popover with the given data. The user interaction or timeout of the popover
will be notified to gadget through the registered action handler.
- Parameters:
- {Object} bannerData
- Refer finesse.containerservices.PopoverSchema#getBannerDataSchema for description about this JSON payload
- {Object} timerData
- Refer finesse.containerservices.PopoverSchema#getTimerDataSchema for description about this JSON payload
- {Object} actionData
- Refer finesse.containerservices.PopoverSchema#getActionDataSchema for description about this JSON payload
- {Function} actionHandler
- This is a Handler that gets called for events due to user interaction. Following are the params of this function.
Parameter Description popoverId A unique popover id that was assigned to the new popover. source The id of the source which generated the event. Examples are 'btn_[id]_click' or 'dismissed' or 'timeout'
- Throws:
- Throws error when the passed in popoverData is not as per defined format.
- Returns:
- {String} Generated Popover-id, can be used for subsequent interaction with the service.
updatePopover(popoverId, bannerData, timerData, actionData, actionHandler)
Modify an active popover's displayed content.
- Parameters:
- {String} popoverId
- A unique popover id that was returned in #showPopover.
- {Object} bannerData
- Refer finesse.containerservices.PopoverSchema#getBannerDataSchema for description about this JSON payload
- {Object} timerData
- Refer finesse.containerservices.PopoverSchema#getTimerDataSchema for description about this JSON payload
- {Object} actionData
- Refer finesse.containerservices.PopoverSchema#getActionDataSchema for description about this JSON payload
- {Function} actionHandler
- Refer The callback function requirements as described in #showPopover
- Throws:
- Throws error when the passed in popoverData is not as per defined format.