getServerTime
Introduction
Get the live server time.
Parameter details
This API has no parameters
Returned template
V2TimValueCallback<number>
{
code : number
desc : string
data : number// The live time on the server.
}
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 | number | The live time on the server. |
Code example
import { TencentImSDKPlugin } from 'react-native-tim-js';
const getServerTimeRes = await TencentImSDKPlugin.v2TIMManager.getServerTime();
if (getServerTimeRes.code === 0) {
getServerTimeRes.data;
}