getLoginStatus

Introduction

Get the login status.

Please do not call the login method frequently, if user is already logged in or in the status of logging in.

Parameter details

This API has no parameters

Returned template

V2TimValueCallback<int>

{
    code : int
    desc : String
    data : int// The login status of the current user
}

Return value details

name type description
code int Request result: Error codes. 0 means success.
desc String The description of the error. It will be empty if success.
data bool The login status of the current user, including 1 means logged in, 2 means logging in, while 3 means not logged.

Code example

    V2TimValueCallback<int> getLoginStatusRes =
        await TencentImSDKPlugin.v2TIMManager.getLoginStatus();
    if (getLoginStatusRes.code == 0) {
      int? status = getLoginStatusRes.data; 
      if (status == 1) {
      } else if (status == 2) {
      } else if (status == 3) {
      }
    }

results matching ""

    No results matching ""