getLoginUser
Introduction
Get the ID of the current logged in user.
You can get the ID of the current logged in user, after logged in.
The result data will be empty, if logged in failed.
Parameter details
This API has no parameters
Returned template
V2TimValueCallback<string>
{
code : number
desc : string
data : string
}
Return value details
name | type | description |
---|---|---|
code | number | Request result: Error codes. 0 means success. |
desc | string | The description of the error. It will be empty if success. |
data | string | The ID of the current logged in user. |
Code example
import { TencentImSDKPlugin } from 'react-native-tim-js';
const getLoginUserRes = await TencentImSDKPlugin.v2TIMManager.getLoginUser();
if (getLoginUserRes.code === 0) {
getLoginUserRes.data;
}