Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • TimbaseManager

Index

SDK APIs (such as the initialization API)

TIMGetSDKVersion

  • TIMGetSDKVersion(): Buffer

TIMGetServerTime

  • TIMGetServerTime(): number
  • brief

    Get the current server time

    note

    This API can be used to determine whether a timeout occurs in offline signaling push scenarios

    Returns number

    Server time

TIMInit

  • brief

    Initialize the IM SDK

    note

    Before using the IM SDK for further operations, you need to initialize the IM SDK.

    Parameters

    Returns number

    The enumeration value returned by TIM_SUCC indicates that the interface invocation is successful, and other values ​​indicate that the interface invocation fails. For the definition of each return value seeTIMResult enumerated values

TIMUninit

  • TIMUninit(): number
  • note

    Call this API to uninstall the IM SDK and clear IM SDK resources before you uninstall the DLL or exit a process.

    Returns number

    The enumeration value returned by TIM_SUCC indicates that the interface invocation is successful, and other values ​​indicate that the interface invocation fails. For the definition of each return value seeTIMResult enumerated values

Basic API callbacks

TIMSetKickedOfflineCallback

  • note

    If a user has logged in on another terminal, the user will be kicked offline and receive a kicked offline notification. The common way to handle this is to inform the user to log out or kick the account on the other terminal offline. If the user is logged out when offline, the subsequent login will fail and a strong alert (login error code ERR_IMSDK_KICKED_BY_OTHERS: 6208) is displayed to the user. Developers can also choose to ignore this error and let the user log in again. Being kicked offline in online state:

    • When the user logs in on device 1 and remains online, the user logs in on device 2 again. At this time, the user is forced to go offline on device 1 and receives a TIMKickedOfflineCallback callback. After the user receives the callback on device 1, the user is prompted to continue to call login to go online and force device 2 to go offline. Here is the process of kicking each other in an online situation.

      Being kicked offline in offline state:

    • A user logs in on device 1 and exits the process without logging out on device 1. The user then logs in on device 2. As the user is offline on device 1, the user cannot detect this event. To explicitly notify the user of the event, the system will return the error code ERR_IMSDK_KICKED_BY_OTHERS: 6208 when the user logs in on device 1 again. This error code indicates that the user was kicked offline the last time and allows the user to determine whether to go offline on the other device. If yes, the user can call login again to log in forcibly, and the instance online on device 2 will receive TIMKickedOfflineCallback.

    Parameters

    Returns void

TIMSetLogCallback

TIMSetNetworkStatusListenerCallback

  • note

    When calling the interface TIMInit , ImSDK will connect to the cloud backend. The callback set by this interface is used to monitor the status of the network connection. The network connection status includes four: connecting, connection failed, connection successful, and connected. The network events here do not indicate the user's local network status, but only indicate whether the ImSDK is connected to the instant messaging IM cloud server. Optional setting, if you want the user to sense whether the server has been connected, you need to set this callback to notify the caller of the connection and disconnection events linked to the communication background. In addition, if the network is disconnected, it will automatically restart after the network is restored. Connect, automatically pull the message to notify the user, the user does not need to care about the network status, it is only used for notification As long as the user is in the logged-in state, ImSDK will disconnect and reconnect internally, and the user does not need to care.

    Parameters

    Returns void

TIMSetUserSigExpiredCallback

  • brief

    Set the callback for ticket expiration

    note

    The user ticket may expire. If the user ticket expires, the callback set by this interface will be called. TIMLoginAn error code of 70001 will also be returned. The developer can replace the ticket according to the error code or the ticket expiration callback

    Parameters

    Returns void

Experimental API

callExperimentalAPI

Login APIs

TIMGetLoginStatus

  • brief

    Get the login status

    note

    If the user is already in the "logged in" or "logging in" state, do not frequently call the login API to log in.

    Returns TIMLoginStatus

    Please refer to the definition of each return value of TIMLoginStatus TIMLoginStatus

TIMGetLoginUserID

TIMLogin

  • note

    The user can send and receive messages normally only after logging in to the Tencent backend server. To log in, the user needs to provide UserID, UserSig and other information. For the specific meaning, please refer toLogin authentication

    Parameters

    Returns Promise<commonResponse>

    Promise response: { code, desc, json_params, user_data }

TIMLogout

Profile APIs

TIMProfileGetUserProfileList

TIMProfileModifySelfUserProfile

Configuration API

TIMSetConfig

  • brief

    Set extra user configurations

    note

    Currently supported configurations include the IP and port of the http proxy, the IP and port of the socks5 proxy, the level of the output log, the default options for obtaining group information/group member information, whether to accept the message read receipt event, etc. The IP and port of the http proxy, the IP and port of the socks5 proxy are recommended to callTIMInitpreviously configured. Each configuration can be set individually or together, please refer to SetConfig

    Parameters

    Returns Promise<unknown>

    Promise response: { code, desc, json_params, user_data }

Generated using TypeDoc