Properties
Private Readonly _channelClient
_channelClient: {} = {}
Private Readonly _defaultChannelClient
Private Readonly _isCPPMode
_isCPPMode: boolean
Constructors
constructor
Parameters
_context: default
logger: ILogger
_storage: AppStorage
Methods
Private assertCPPMode
- assertCPPMode<T, N, O>(method: (() => N), methodName: string, callback?: ICallback<T, O>): void
Type Parameters
Parameters
method: (() => N)
methodName: string
Optional callback: ICallback<T, O>
Returns void
install
- install<T, O>(plugin: IPluginGenerator<T, O>, options: O): null | T
Type Parameters
Parameters
plugin: IPluginGenerator<T, O>
options: O
Returns null | T
getChannel
Parameters
deleteChannels
- deleteChannels(channelIds: string[]): void
Parameters
Returns void
getNavi
- getNavi(): {} | INaviInfo
Returns {} | INaviInfo
getSDKInfo
- getSDKInfo(): { version: string }
Returns { version: string }
getAppInfo
- getAppInfo(): { appKey: string }
Returns { appKey: string }
getCurrentUserId
- getCurrentUserId(): string
Returns string
disconnect
- disconnect(closeDB?: boolean): Promise<void>
Parameters
Optional closeDB: boolean
Returns Promise<void>
logout
Returns Promise<void>
clearCache
Returns void
getDeviceId
Returns string
getConversationList
- getConversationList(callback: ICallback<IConversation[], void>, conversationTypes: null | Number[], count?: number): void
Parameters
conversationTypes: null | Number[]
Optional count: number
Returns void
getConversationListWithAllChannel
Parameters
Returns void
getConversationListWithAllChannelByPage
- getConversationListWithAllChannelByPage(callback: ICallback<IConversation[], void>, index: number, limit?: number): void
Parameters
index: number
limit: number = 30
Returns void
getConversation
Parameters
Returns void
removeConversation
Parameters
targetId: string
callback: ICallback<void, void>
Returns void
saveTextMessageDraft
- saveTextMessageDraft(conversationType: ConversationType, targetId: string, draftText: string): boolean
Parameters
targetId: string
draftText: string
Returns boolean
getTextMessageDraft
- getTextMessageDraft(conversationType: ConversationType, targetId: string): undefined | string
Parameters
Returns undefined | string
clearTextMessageDraft
- clearTextMessageDraft(conversationType: ConversationType, targetId: string): boolean
Parameters
Returns boolean
getTotalUnreadCount
Parameters
callback: ICallback<number, void>
Optional includeMuted: boolean
Returns void
getUnreadCount
Parameters
targetId: string
callback: ICallback<number, void>
Returns void
getConversationUnreadCount
Parameters
Returns void
clearConversations
Parameters
Returns void
clearUnreadCount
Parameters
targetId: string
callback: ICallback<boolean, void>
Returns void
clearAllUnreadCount
- clearAllUnreadCount(callback: ICallback<boolean, void>): void
Parameters
Returns void
setConversationStatus
Parameters
targetId: string
callback: ICallback<void, void>
Returns void
sendMessage
Parameters
targetId: string
Optional isMentioned: boolean
Optional pushContent: string
Optional pushData: string
Optional methodType: number
Returns void
sendRecallMessage
Parameters
Returns void
sendTypingStatusMessage
Parameters
targetId: string
typingContentType: string
Returns void
sendReceiptResponse
Parameters
Returns void
sendReadReceiptMessage
- sendReadReceiptMessage(messageUIds: string[], targetId: string, callback: ICallback<void, void>): void
Parameters
messageUIds: string[]
targetId: string
callback: ICallback<void, void>
Returns void
getMessageReader
Parameters
messageUId: string
targetId: string
Returns void
updateMessageExpansion
Parameters
expansionDic: {}
callback: ICallback<void, void>
Returns void
removeMessageExpansionForKey
Parameters
keys: string[]
callback: ICallback<void, void>
Returns void
getHistoryMessages
Parameters
targetId: string
timestamp: number
count: number
Optional objectName: string
Optional order: 0 | 1
Returns void
joinChatRoom
- joinChatRoom(chatRoomId: string, count: number, callback: ICallback<void, void>): void
Parameters
chatRoomId: string
count: number
callback: ICallback<void, void>
Returns void
quitChatRoom
- quitChatRoom(chatRoomId: string, callback: ICallback<void, void>): void
Parameters
chatRoomId: string
callback: ICallback<void, void>
Returns void
getChatRoomInfo
Parameters
chatRoomId: string
count: number
order: 1 | 2
Returns void
setChatroomEntry
Parameters
chatRoomId: string
callback: ICallback<void, void>
Returns void
setChatRoomEntries
Parameters
chatRoomId: string
callback: ICallback<void, void>
Returns void
forceSetChatroomEntry
Parameters
chatRoomId: string
callback: ICallback<void, void>
Returns void
removeChatroomEntry
Parameters
chatRoomId: string
callback: ICallback<void, void>
Returns void
removeChatRoomEntries
- removeChatRoomEntries(chatRoomId: string, options: { entries: string[] }, callback: ICallback<void, void>): void
Parameters
chatRoomId: string
options: { entries: string[] }
callback: ICallback<void, void>
Returns void
forceRemoveChatroomEntry
Parameters
chatRoomId: string
callback: ICallback<void, void>
Returns void
getChatroomEntry
- getChatroomEntry(chatRoomId: string, key: string, callback: ICallback<string, void>): void
Parameters
chatRoomId: string
key: string
callback: ICallback<string, void>
Returns void
getAllChatroomEntries
- getAllChatroomEntries(chatRoomId: string, callback: ICallback<{}, void>): void
Parameters
chatRoomId: string
callback: ICallback<{}, void>
Returns void
getChatRoomHistoryMessages
- getChatRoomHistoryMessages(chatRoomId: string, count: number, order: 0 | 1, callback: ICallback<IReceivedMessageV2[], boolean>, timestamp?: number): void
Parameters
chatRoomId: string
count: number
order: 0 | 1
timestamp: number = 0
Returns void
setDeviceInfo
- setDeviceInfo(option: { id: string }): void
Parameters
Returns void
getCurrentConnectionStatus
deleteRemoteMessages
Parameters
targetId: string
callback: ICallback<void, void>
Returns void
clearRemoteHistoryMessages
Parameters
Returns void
getFileToken
- getFileToken(fileType: FileType, callback: ICallback<IUploadAuth & { bos: string; qiniu: string }, void>, fileName?: string, httpMethod?: "PUT" | "POST", queryString?: string): void
Parameters
callback: ICallback<IUploadAuth & { bos: string; qiniu: string }, void>
Optional fileName: string
Optional httpMethod: "PUT" | "POST"
Optional queryString: string
Returns void
getFileUrl
Parameters
fileName: string
saveName: string
Optional uploadRes: { isBosRes: boolean; downloadUrl: string }
isBosRes: boolean
downloadUrl: string
Returns void
createTag
Parameters
Returns void
removeTag
- removeTag(tagId: string, callback: ICallback<void, void>): void
Parameters
Returns void
updateTag
Parameters
Returns void
getTagList
Parameters
Returns void
getTagsForConversation
Parameters
Returns void
addTagForConversations
Parameters
Returns void
removeTagForConversations
Parameters
Returns void
removeTagsForConversation
Parameters
tagIds: string[]
callback: ICallback<void, void>
Returns void
getConversationListByTag
Parameters
tagId: string
count: number
startTime: number
Returns void
getUnreadCountByTag
- getUnreadCountByTag(tagId: string, containMuted: boolean, callback: ICallback<number, void>): void
Parameters
tagId: string
containMuted: boolean
callback: ICallback<number, void>
Returns void
setConversationStatusInTag
- setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: { isTop: boolean }, callback: ICallback<void, void>): void
Parameters
tagId: string
status: { isTop: boolean }
callback: ICallback<void, void>
Returns void
callExtra
- callExtra(method: string, callback: ICallback<unknown, unknown>, ...args: any[]): void
Parameters
method: string
callback: ICallback<unknown, unknown>
Rest ...args: any[]
Returns void
hasRemoteUnreadMessages
- hasRemoteUnreadMessages(token: string, callback: ICallback<Boolean, void>): void
Parameters
token: string
callback: ICallback<Boolean, void>
Returns void
setUserStatusListener
- setUserStatusListener(config: { userIds: string[] }, listener: Function): void
Parameters
config: { userIds: string[] }
listener: Function
Returns void
setUserStatus
- setUserStatus(status: number, callback: ICallback<Boolean, void>): void
Parameters
status: number
callback: ICallback<Boolean, void>
Returns void
getUserStatus
- getUserStatus(userId: string, callback: ICallback<{ status?: number }, void>): void
Parameters
userId: string
callback: ICallback<{ status?: number }, void>
Returns void
addToBlacklist
- addToBlacklist(userId: string, callback: ICallback<void, void>): void
Parameters
userId: string
callback: ICallback<void, void>
Returns void
removeFromBlacklist
- removeFromBlacklist(userId: string, callback: ICallback<void, void>): void
Parameters
userId: string
callback: ICallback<void, void>
Returns void
getBlacklist
- getBlacklist(callback: ICallback<string[], void>): void
Parameters
Returns void
getBlacklistStatus
- getBlacklistStatus(userId: string, callback: ICallback<number, void>): void
Parameters
userId: string
callback: ICallback<number, void>
Returns void
insertMessage
Parameters
Returns void
batchInsertMessage
Parameters
checkDuplicate: boolean
callback: ICallback<boolean, void>
Returns void
getMessageCount
Parameters
targetId: string
callback: ICallback<number, void>
Returns void
getRemoteHistoryMessages
Parameters
targetId: string
timestamp: number
count: number
options: { order?: 0 | 1 } = {}
Returns void
deleteLocalMessages
Parameters
__: string
messageIds: 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
clearMessages
Parameters
targetId: string
callback: ICallback<boolean, void>
Returns void
getMessage
Parameters
messageId: string | number
Returns void
setMessageSentStatus
- setMessageSentStatus(messageId: number, sentStatus: number, callback: ICallback<boolean, void>): void
Parameters
messageId: number
sentStatus: number
callback: ICallback<boolean, void>
Returns void
setMessageReceivedStatus
- setMessageReceivedStatus(messageId: number, receivedStatus: number, callback: ICallback<boolean, void>): void
Parameters
messageId: number
receivedStatus: number
callback: ICallback<boolean, void>
Returns void
setMessageContent
- setMessageContent(messageId: number, content: any, objectName: string, callback: ICallback<boolean, void>): void
Parameters
messageId: number
content: any
objectName: string
callback: ICallback<boolean, void>
Returns void
setMessageSearchField
- setMessageSearchField(messageId: number, content: any, searchFiles: string): void
Parameters
messageId: number
content: any
searchFiles: string
Returns void
searchConversationByContent
Parameters
keyword: string
Optional customMessageTypes: string[]
Returns void
searchConversationByContentWithAllChannel
Parameters
keyword: string
customMessageTypes: string[] = []
Returns void
searchMessageByContent
Parameters
targetId: string
keyword: string
timestamp: number
count: number
total: number
Returns void
searchMessageByContentWithAllChannel
Parameters
targetId: string
keyword: string
timestamp: number
count: number
Returns void
searchMessageByContentInTimeRangeWithAllChannel
- searchMessageByContentInTimeRangeWithAllChannel(conversationType: ConversationType, targetId: string, keyword: string, startTime: number, endTime: number, offset: number, limit: number, callback: ICallback<IReceivedMessageV2[], void>): void
Parameters
targetId: string
keyword: string
startTime: number
endTime: number
offset: number
limit: number
Returns void
getUnreadMentionedMessages
Parameters
clearUnreadCountByTimestamp
- clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, callback: ICallback<boolean, void>): void
Parameters
targetId: string
timestamp: number
callback: ICallback<boolean, void>
Returns void
getFirstUnreadMessage
Parameters
Returns void
getConversationNotificationStatus
Parameters
Returns void
getServerTime
Returns number
getGroupMessageDeliverList
- getGroupMessageDeliverList(targetId: string, messageUId: string, callback: ICallback<IGroupMessageDeliverInfo, void>): void
Parameters
targetId: string
messageUId: string
callback: ICallback<IGroupMessageDeliverInfo, void>
Returns void
getPrivateMessageDeliverTime
- getPrivateMessageDeliverTime(messageUId: string, callback: ICallback<number, void>): void
Parameters
messageUId: string
callback: ICallback<number, void>
Returns void
协议栈方法校验