Legacy SDK APIs (Android)

Last updated: 2021-01-06 15:13:02

    TIMManager

    As a core component of the IM SDK, TIMManager works for the initialization, login, conversation creation, and push management of the IM SDK.

    • Initialization: is the prerequisite for using the IM SDK. You need to call the init API before calling other APIs.
    • Login: you need to configure SDKAppID, UserID, and UserSig before using IM.
    • Conversation: each time you start a conversation, you open a conversation window. A conversation can be a C2C chat or a group chat.
    • Push: you can configure and manage features related to offline push, including tokens and feature enabling and disabling.

    Initialization APIs

    API Description
    getInstance Obtains the instance of TIMManager.
    init Initializes the SDK and specifies the global configuration.
    unInit Uninitializes the SDK.
    getSdkConfig Obtains the global configuration.
    setUserConfig Specifies user configurations.
    getUserConfig Obtains user configurations.
    addMessageListener Adds a message receiving listener.
    removeMessageListener Removes a message receiving listener.
    isInited Checks whether the SDK is initialized.

    Login APIs

    API Description
    login Logs in.
    autoLogin Enables auto-login.
    logout Logs out.
    getLoginUser Obtains the logged-in user.
    getLoginStatus Obtains the current login status.

    Conversation management APIs

    API Description
    getConversationList Obtains the list of conversations.
    getConversation Obtains a conversation.
    deleteConversation Deletes a conversation.
    deleteConversationAndLocalMsgs Deletes a conversation and its messages.

    APIs for configuring offline push

    API Description
    setOfflinePushToken Configures the client token and the certificate busiID.
    setOfflinePushSettings Initializes the offline push configuration. Use this API after you have logged in to ensure that the configuration takes effect.
    getOfflinePushSettings Obtains the offline push configuration. Use this API after you have logged in.
    setOfflinePushListener Configures the message notification listener that works when the app is running at the backend. (This API has been deprecated.)
    doBackground Reports that the app is running at the backend.
    doForeground Reports that the app is running at the frontend.

    APIs for querying local conversations and messages without login

    API Description
    initStorage Loads the local storage without login.

    Debugging APIs

    API Description
    getVersion Obtains the version number.
    addMessageUpdateListener Adds a message update listener to obtain message updates.
    removeMessageUpdateListener Deletes a message update listener.
    getNetworkStatus Obtains the network connection status.
    getServerTimeDiff Obtains the time difference in the unit of seconds between the server and local device. Time difference = svrTime – localTime.

    TIMConversation

    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 related to message operations, including sending messages, obtaining the message history, setting read receipts, recalling messages, and deleting messages.

    APIs for sending messages

    </
    API Description
    sendMessage Sends a message.
    sendOnlineMessage Sends an online message. (Incognito)