Options
All
  • Public
  • Public/Protected
  • All
Menu

This class to manage notification

Hierarchy

  • WemNotificationProvider

Index

Constructors

Properties

embeddedPageLoaded: boolean = false
embeddedPagesLinks: string[] = []
logger: Logger = ...
notificationBase: CXoneNotificationManager = ...
notificationMessages: WemNotificationMessage[] = []
validationUtils: ValidationUtils = ...
wemNotificationSvc: WemNotificationService = ...
wemWorker: any

Methods

  • attemptReconnect(): void
  • This method to perform the different actions on callback response

    example
    attemptReconnect();
    

    Returns void

  • Use to get polling request parameters for leader election

    example
    this.getWemNotificationPollingConfig();
    

    Returns WemNotificationRequestData

    • notification request parameters
  • handleWemNotificationWSResponse(wsResponse: WsResponse, isPostedFromLeader?: boolean): Promise<void>
  • This method to perform the different actions on callback response of worker events

    example
    handleWemNotificationWSResponse(wsResponse);
    

    Parameters

    • wsResponse: WsResponse
    • Optional isPostedFromLeader: boolean

    Returns Promise<void>

  • initWemNotificationWorker(): void
  • Use to initializing the wem notification worker and will return the method inside the worker

    example
    this.initWemNotificationWorker();
    

    Returns void

  • initialWemNotifications(): Promise<void>
  • Use to load initial wem notifications from index db for non-leader

    example
    this.initialWemNotifications();
    

    Returns Promise<void>

  • isSupportedByEmbeddedPages(notificationURL: string): boolean
  • This method to check notification url is supported by embedded pages

    example
    isSupportedByEmbeddedPages('https://na1.dev.nice.com/wfm/#/mySchedule?date=2022-01-12')
    

    Parameters

    • notificationURL: string

      notification url

    Returns boolean

    • boolean
  • This method to get embedded pages links and publish wem notification whenever we get response of that api we set "embeddedPageLoaded" property true then process the messages from notificationMessages array and publish the notification to the consumer

    example
    onWemEmbeddedPageLinkResponse(response)
    

    Parameters

    Returns Promise<void>

  • This method to manipulate and publish notification messages when websocket is connection is authenticate we receive "CONNECTED" command from ws server so first we getEmbeddedPages api and in which we required embedded pages links to filter notification messages until we will not api response will store the all messages into "notificationMessages" array.

    example
    onWemNotificationMessage(message)
    

    Parameters

    Returns Promise<void>

  • This method to process notification messages

    example
    publishWemNotification(message)
    

    Parameters

    Returns Promise<void>

  • This method to send message is ready Acknowledgement to WebSocket

    example
    sendAcknowledge('abc1234')
    

    Parameters

    • msgId: string

      Notification message id

    Returns Promise<void | CXoneSdkError>

    • boolean | CXoneSdkError
  • This method to start websocket

    example
    startWebsocket({'en-US', 'Asia/Calcutta',{maxRetryAttempts:5, retryInterval: 2000}});
    

    Parameters

    Returns void

    • started ws connection or CXoneSdkError
  • Use to terminate the ws worker instance

    example
    this.terminateWsWorker();
    

    Returns void | CXoneSdkError

Generated using TypeDoc