Constructors
constructor
- new ChannelClient(_context: APIContext, channelId: string, _isCPPMode: boolean, _readReceiptTimeout: number): ChannelClient
Parameters
_context: APIContext
channelId: string
_isCPPMode: boolean
_readReceiptTimeout: number
Properties
Readonly channelId
channelId: string
Methods
clearConversations
- clearConversations(callback: ICallback<boolean, void>, conversationTypes: ConversationType[]): void
Parameters
callback: ICallback<boolean, void>
Returns void
clearMessages
- clearMessages(conversationType: ConversationType, targetId: string, callback: ICallback<boolean, void>): void
Parameters
targetId: string
callback: ICallback<boolean, void>
Returns void
clearRemoteHistoryMessages
- clearRemoteHistoryMessages(param: IDelteByTime, callback: ICallback<void, void>): void
Parameters
param: IDelteByTime
callback: ICallback<void, void>
Returns void
clearTextMessageDraft
- clearTextMessageDraft(conversationType: ConversationType, targetId: string): boolean
Parameters
Returns boolean
clearUnreadCount
- clearUnreadCount(conversationType: ConversationType, targetId: string, callback: ICallback<boolean, void>): void
Parameters
targetId: string
callback: ICallback<boolean, void>
Returns void
clearUnreadCountByTimestamp
- clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, callback: ICallback<boolean, void>): void
Parameters
targetId: string
timestamp: number
callback: ICallback<boolean, void>
Returns void
deleteLocalMessagesByTimestamp
- deleteLocalMessagesByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, callback: ICallback<boolean, void>): void
Parameters
targetId: string
timestamp: number
cleanSpace: boolean
callback: ICallback<boolean, void>
Returns void
deleteRemoteMessages
- deleteRemoteMessages(conversationType: ConversationType, targetId: string, messages: IDeleteMessge[], callback: ICallback<void, void>): void
Parameters
targetId: string
messages: IDeleteMessge[]
callback: ICallback<void, void>
Returns void
getConversation
Parameters
Returns void
getConversationList
- getConversationList(callback: ICallback<IConversation[], void>, conversationTypes: null | Number[], count?: number): void
Parameters
callback: ICallback<IConversation[], void>
conversationTypes: null | Number[]
Optional count: number
Returns void
getConversationNotificationStatus
- getConversationNotificationStatus(conversationType: ConversationType, targetId: string, callback: ICallback<NotificationStatus, void>): void
Parameters
targetId: string
callback: ICallback<NotificationStatus, void>
Returns void
getFirstUnreadMessage
- getFirstUnreadMessage(conversationType: ConversationType, targetId: string, callback: ICallback<null | IReceivedMessageV2, void>): void
Parameters
targetId: string
callback: ICallback<null | IReceivedMessageV2, void>
Returns void
getHistoryMessages
- getHistoryMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, callback: ICallback<IReceivedMessageV2[], boolean>, objectName?: string, order?: 0 | 1): void
Parameters
targetId: string
timestamp: number
count: number
callback: ICallback<IReceivedMessageV2[], boolean>
Optional objectName: string
Optional order: 0 | 1
Returns void
getMessageReader
- getMessageReader(messageUId: string, targetId: string, callback: ICallback<IMessageReaderResponse, void>): void
Parameters
messageUId: string
targetId: string
Returns void
getRemoteHistoryMessages
- getRemoteHistoryMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, callback: ICallback<IReceivedMessageV2[], boolean>, options: { order?: 0 | 1 }): void
Parameters
targetId: string
timestamp: number
count: number
callback: ICallback<IReceivedMessageV2[], boolean>
options: { order?: 0 | 1 }
Returns void
getTextMessageDraft
- getTextMessageDraft(conversationType: ConversationType, targetId: string): undefined | string
Parameters
Returns undefined | string
getTotalUnreadCount
- getTotalUnreadCount(callback: ICallback<number, void>, conversationTypes?: ConversationType[], includeMuted?: boolean): void
Parameters
callback: ICallback<number, void>
Optional includeMuted: boolean
Returns void
getUnreadCount
- getUnreadCount(conversationType: ConversationType, targetId: string, callback: ICallback<number, void>): void
Parameters
targetId: string
callback: ICallback<number, void>
Returns void
getUnreadMentionedMessages
- getUnreadMentionedMessages(conversationType: ConversationType, targetId: string): IReceivedMessageV2[]
Parameters
Returns IReceivedMessageV2[]
insertMessage
- insertMessage(conversationType: ConversationType, targetId: string, content: IReceivedMessageV2, callback: ICallback<IReceivedMessageV2, void>, options?: IInsertOptions): void
Parameters
targetId: string
content: IReceivedMessageV2
callback: ICallback<IReceivedMessageV2, void>
options: IInsertOptions = {}
Returns void
removeConversation
- removeConversation(conversationType: ConversationType, targetId: string, callback: ICallback<void, void>): void
Parameters
targetId: string
callback: ICallback<void, void>
Returns void
removeMessageExpansionForKey
- removeMessageExpansionForKey(keys: string[], message: IReceivedMessageV2, callback: ICallback<void, void>): void
Parameters
keys: string[]
message: IReceivedMessageV2
callback: ICallback<void, void>
Returns void
saveTextMessageDraft
- saveTextMessageDraft(conversationType: ConversationType, targetId: string, draftText: string): boolean
Parameters
targetId: string
draftText: string
Returns boolean
searchConversationByContent
- searchConversationByContent(keyword: string, callback: ICallback<IConversation[], void>, conversationTypes?: ConversationType[], customMessageType?: string[]): void
Parameters
keyword: string
callback: ICallback<IConversation[], void>
Optional customMessageType: string[]
Returns void
searchMessageByContent
- searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, callback: ICallback<IReceivedMessageV2[], number>): void
Parameters
targetId: string
keyword: string
timestamp: number
count: number
total: number
callback: ICallback<IReceivedMessageV2[], number>
Returns void
sendMessage
- sendMessage(conversationType: ConversationType, targetId: string, msg: BaseMessage<any>, callback: ISendCallback<IReceivedMessageV2, void>, isMentioned?: boolean, pushContent?: string, pushData?: string, options?: ISendOptionsV2): void
Parameters
targetId: string
msg: BaseMessage<any>
callback: ISendCallback<IReceivedMessageV2, void>
Optional isMentioned: boolean
Optional pushContent: string
Optional pushData: string
Optional options: ISendOptionsV2
Returns void
sendReadReceiptMessage
- sendReadReceiptMessage(messageUIds: string[], targetId: string, callback: ICallback<void, void>): void
Parameters
messageUIds: string[]
targetId: string
callback: ICallback<void, void>
Returns void
sendRecallMessage
- sendRecallMessage(message: IReceivedMessageV2, callback: ICallback<IReceivedMessageV2, void>, options?: IRecallOptionsV2): void
Parameters
message: IReceivedMessageV2
callback: ICallback<IReceivedMessageV2, void>
Optional options: IRecallOptionsV2
Returns void
sendReceiptResponse
- sendReceiptResponse(conversationType: ConversationType, targetId: string, callback: ICallback<null | IReceivedMessageV2, void>): void
Parameters
targetId: string
callback: ICallback<null | IReceivedMessageV2, void>
Returns void
sendTypingStatusMessage
- sendTypingStatusMessage(conversationType: ConversationType, targetId: string, typingContentType: string, callback: ICallback<IReceivedMessageV2, void>): void
Parameters
targetId: string
typingContentType: string
callback: ICallback<IReceivedMessageV2, void>
Returns void
setConversationStatus
- setConversationStatus(conversationType: ConversationType, targetId: string, status: IConversationStatus, callback: ICallback<void, void>): void
Parameters
targetId: string
status: IConversationStatus
callback: ICallback<void, void>
Returns void
updateMessageExpansion
- updateMessageExpansion(expansionDic: {}, message: IReceivedMessageV2, callback: ICallback<void, void>): void
Parameters
expansionDic: {}
message: IReceivedMessageV2
callback: ICallback<void, void>
Returns void
删除指定类型会话,该方法已弃用
仅可在协议栈连接下调用