StringeeClientListener class
Represents the event from the StringeeClient.
Constructors
StringeeClientListener()
Create a new StringeeClientListener.
Methods
onConnect: (stringeeClient: StringeeClient, userId: string) => void
Invoked when the StringeeClient is connected.
- userId: It's the unique identifier of the client on Stringee system.
onDisConnect: (stringeeClient: StringeeClient) => void
Invoked when the StringeeClient is disconnected.
onFailWithError: (stringeeClient: StringeeClient, code: number, message: string) => void
Invoked when StringeeClient connect false.
- userId: It's the unique identifier of the client on Stringee system.
- code = 1, message = "Access token is empty"
- code = 2, message = "Access token can not be decoded"
- code = 3, message = "Access token invalid format"
- code = 4, message = "Access token does not use HS256"
- code = 5, message = "API key sid or account sid not found"
- code = 6, message = "Access token expired or invalid"
- code = 7, message = "Access token invalid payload"
- code = 8, message = "Project not found"
onRequestAccessToken: (stringeeClient: StringeeClient) => void
Invoked when your token is expired. You must get a new token and reconnect.
onIncomingCall: (stringeeClient: StringeeClient, stringeeCall: StringeeCall) => void
Invoked when receive an incoming of StringeeCall.
onIncomingCall2: (stringeeClient: StringeeClient, stringeeCall2: StringeeCall2 ) => void
Invoked when receive an incoming of StringeeCall2.
onCustomMessage: (stringeeClient: StringeeClient, from: string, data: {}) => void
Invoked when receive custom message.
- from: It's identifier of user who send custom message.
- data: It's data of custom message.
onObjectChange: (stringeeClient: StringeeClient, objectType: ObjectType, objectChanges: Array, changeType: ChangeType) => void
Invoked when receive an chat change event.
- objectType: It's the type of updated object:
- changeType: It's the type of change:
- insert: Notify an object is created or inserted.
- update: Notify an object is updated.
- delete: Notify an object is deleted.
- objectChanges: A set of updated objects.
onReceiveChatRequest: (stringeeClient: StringeeClient, chatRequest: ChatRequest) => void
Invoked when receive a chat request.
onReceiveTransferChatRequest: (stringeeClient: StringeeClient, chatRequest: ChatRequest) => void
Invoked when receive a transfer chat request.
onTimeoutAnswerChat: (stringeeClient: StringeeClient, chatRequest: ChatRequest) => void
Invoked when chat request to agent timeout.
onTimeoutInQueue: (stringeeClient: StringeeClient, convId: string, customerId: string, customerName: string) => void
Invoked when no agent accept chat request and time out.
- convId: It's the identifier of conversation.
- customerId: It's the identifier of customer.
- customerName: It's the name of customer.
onConversationEnded: (stringeeClient: StringeeClient, convId: string, endedBy: string) => void
Invoked when conversation end.
- convId: It's the identifier of conversation.
- endedby: It's the identifier of user who end this conversation.
onUserBeginTyping: (stringeeClient: StringeeClient, convId: string, userId: string, displayName: string) => void
Invoked when other user send begin typing event.
- convId: It's the identifier of conversation.
- userId: It's the identifier of user who send begin typing.
- displayName: It's the name of user who send begin typing.
onUserEndTyping: (stringeeClient: StringeeClient, convId: string, userId: string, displayName: string) => void
Invoked when other user send end typing event.
- convId: It's the identifier of conversation.
- userId: It's the identifier of user who send begin typing.
- displayName: It's the name of user who send begin typing.