As a core module of the IM SDK, TIMManager works for initialization, login, conversation creation, and push management of the IM SDK.
API | Description |
---|---|
sharedInstance | Obtains the instance of TIMManager. |
initSdk | Initializes the SDK and specifies the global configurations. |
unInit | Uninitialize the SDK. |
getGlobalConfig | Obtains global configurations. |
setUserConfig | Specifies user configurations. |
getUserConfig | Obtains user configurations. |
addMessageListener | Adds a message receiving listener. |
removeMessageListener | Deletes a message receiving listener. |
API | Description |
---|---|
login | Logs in. |
autoLogin | Enables auto-login. |
logout | Logs out. |
getLoginUser | Obtains the login user. |
getLoginStatus | Obtains the current login status. |
API | Description |
---|---|
getConversationList | Obtains the list of conversations. |
getConversation | Obtains a conversation. |
deleteConversation | Deletes a conversation. |
deleteConversationAndMessages | Deletes a conversation and its messages. |
API | Description |
---|---|
setToken | Configures the client token and the certificate business ID. |
setAPNS | Configures APNs. |
getAPNSConfig | Obtains the APNs configurations. |
doBackground | Reports that the app is running in the backend. |
doForeground | Reports that the app is running in the frontend. |
API | Description |
---|---|
initStorage | Loads the local storage without login. |
API | Description |
---|---|
GetVersion | Obtains the version number. |
log | Prints the log. |
getLogPath | Obtains the log file path. |
getIsLogPrintEnabled | Obtains the log printing status. |
getLogLevel | Obtains the log level. |
Each time you start a conversation, you open a conversation window. A conversation can be a C2C chat or a group chat.
All API functions provided by TIMConversation are about message operations, including sending messages, obtaining message history, setting read receipt, recalling messages, and deleting messages.
API | Description |
---|---|
sendMessage | Sends a message. |
sendOnlineMessage | Sends an online message. (Incognito) |
API | Description |
---|---|
getMessage | Pulls message history from the cloud. |
getLocalMessage | Obtains message history from the local database. |
getLastMsg | Obtains the last message of the current conversation. |
API | Description |
---|---|
setReadMessage | Marks a message as read. |
getUnReadMessageNum | Obtains the number of unread messages. |
API | Description |
---|---|
revokeMessage | Recalls a sent message. |
deleteLocalMessage | Deletes local message history of the current conversation. |
API | Description |
---|---|
getType | Obtains the conversation type. |
getReceiver | Obtains the conversation ID. |
getGroupName | Obtains the group name. |
API | Description |
---|---|
setDraft | Adds an unfinished message as a draft. |
getDraft | Obtains a draft. |
API | Description |
---|---|
saveMessage | Adds a message to the list of local messages without sending it. |
importMessages | Imports a message to the local database. |
Group management module is used to create groups, delete groups, invite/delete group members, modify group/member profiles.
API | Description |
---|---|
sharedInstance | Obtains the instance of TIMGroupManager. |
API | Description |
---|---|
createPrivateGroup | Creates a private group. |
createPublicGroup | Creates a public group. |
createChatRoomGroup | Creates a chat room. |
createAVChatRoomGroup | Creates an audio & video chat room. |
createGroup | Creates a group with specific type and ID. |
createGroup | Creates a custom group. |
deleteGroup | Disbands a group. |
joinGroup | Applies for joining a group. |
quitGroup | Quits a group. |
API | Description |
---|---|
inviteGroupMember | Invites a friend to join a group. |
deleteGroupMemberWithReason | Deletes a group member. |
API | Description |
---|---|
getGroupList | Obtains the group lists. |
getGroupInfo | Obtains group information from the server. |
queryGroupInfo | Obtains group information from local storage. |
getGroupMembers | Obtains the list of group members. |
getGroupSelfInfo | Obtains your profile in the group. |
getGroupMembersInfo | Obtains the profiles of specific members. |
getGroupMembers | Obtains a list of a specific type of group members (filtered by field, displayed in pagination mode). |
getReciveMessageOpt | Obtains the options for receiving messages. |
API | Description |
---|---|
modifyGroupName | Modifies the group name. |
modifyGroupIntroduction | Modifies the group introduction. |
modifyGroupNotification | Modifies the group announcement. |
modifyGroupFaceUrl | Modifies the group profile photo. |
modifyGroupAddOpt | Modifies the options for joining the group. |
modifyGroupSearchable | Modifies the search attributes. |
modifyReceiveMessageOpt | Modifies the options for receiving messages. |
modifyGroupAllShutup | Modifies the global mute attributes. |
modifyGroupCustomInfo | Modifies the custom fields. |
modifyGroupOwner | Transfers the group ownership. |
API | Description |
---|---|
modifyGroupMemberInfoSetNameCard | Modifies the name card of a group member. |
modifyGroupMemberInfoSetRole | Modifies the role of a group member. |
modifyGroupMemberVisible | Modifies the visibility attribute of a group member. |
modifyGroupMemberInfoSetSilence | Mutes users. |
modifyGroupMemberInfoSetCustomInfo | Modifies the custom fields of a group member. |
API | Description |
---|---|
getPendencyFromServer | Obtains the list of pending group requests. |
pendencyReport | Reports that the pending group requests have been read. |
TIMFriendshipManager is the module for managing profile relationship chains. You can use it to add friends, delete friends, obtain friend information, modify friend profiles, etc.
API | Description |
---|---|
sharedInstance | Obtains the instance of TIMFriendshipManager. |
modifySelfProfile | Configures your personal profile. |
getSelfProfile | Obtains your personal profile. |
querySelfProfile | Queries your personal profile in the cache. |
getUsersProfile | Obtains profiles of specific users. |
queryUserProfile | Queries the profile of a specific user in the cache. |
getFriendList | Obtains the friends list. |
queryFriend | Queries the relationship chain data of a user in the cache. |
queryFriendList | Obtains the relationship chain lists in the cache. |
checkFriends | Checks the friendships of a specific user. |
addFriend | Adds friend. |
doResponse | Responds to a friend request. |
deleteFriends | Deletes friend. |
modifyFriend | Modifies friend attributes. |
getPendencyList | Deletes the list of pending requests. |
deletePendency | Deletes pending requests. |
pendencyReport | Reports that the pending requests have been read. |
getBlackList | Obtains the blacklist. |
addBlackList | Adds a user to the blacklist. |
deleteBlackList | Deletes a specific user from the blacklist. |
createFriendGroup | Creates a friend group. |
getFriendGroups | Obtains specified friend group information. |
deleteFriendGroup | Deletes a friend group. |
renameFriendGroup | Renames a friend group. |
addFriendsToFriendGroup | Adds a friend to a specific friend group. |
deleteFriendsFromFriendGroup | Deletes specific friends from a friend group. |
TIMMessage consists of multiple message elements TIMElem. The TIMElem can be text or an image, and each message can contain multiple texts or images.
API | Description |
---|---|
addElem | Adds Elem. |
getElem | Obtains the element of the corresponding index. |
elemCount | Obtains the number of elements. |
setBusinessCmd | Configures the business command words. |
status | Queries message status. |
isSelf | Confirms whether you are the sender. |
sender | Obtains the message sender. |
msgId | Obtains the message ID. |
uniqueId | Obtains the the message uniqueId. |
timestamp | Obtains the message timestamp. |
isReaded | Checks whether you have read the message. |
isPeerReaded | Checks whether the message has been read (Work for C2C message only.) |
locator | Obtains the message locator. |
respondsToLocator | Checks whether the message is the one specified by the locator. |
remove | Deletes a message. |
getConversation | Obtains a conversation. |
getSenderProfile | Obtains the sender profile. |
getSenderGroupMemberProfile | Obtains the sender profile in the group. |
setPriority | Configures message priority (for group message only). |
getPriority | Obtains message priority (for group message only). |
setOfflinePushInfo | Configures parameters related to offline push. |
getOfflinePushInfo | Obtains the offline push configurations of messages. |
setCustomInt | Configures the custom integer. The default value is 0. |
customInt | Obtains the custom integer. |
setCustomData | Configures the custom data. The default data is an empty string ("" ). |
customData | Obtains the custom data. |
copyFrom | Copies the attributes of a message, including Elem , priority , online , and offlinePushInfo . |
convertToImportedMsg | Imports the message to local storage. |
setTime | Configures the message timestamp. |
setSender | Configures the message sender. |
Was this page helpful?