TIMFriendshipGetFriendProfileList
Introduction
Get friend's profile list
This returns all friend's profile FriendProfile.
What should I do if the user profile obtained in the Enhanced edition is not the latest?
Friend's profile: When the profile of a friend is updated, the backend will send a system notification to the SDK, so the profile will be updated in real time.
Non-friend user's profile: When the profile of a non-friend user is updated, the backend cannot send a system notification to the SDK; therefore, the profile cannot be updated in real time. To avoid sending a network request to the backend every time the user profile is obtained, the SDK adds the caching logic and allows a user to pull the profile from the backend every ten minutes.
Parameter details
Parameter name | Parameter type | Required | Description |
---|---|---|---|
getFriendProfileListParam | GetFriendProfileListParams | yes | Param of getting friend's profile list |
Returned template
Promise<commonResult<Array<FriendProfile>>>
{
code: TIMResult | TIMErrCode;
desc?: string | undefined;
json_param?: Array<FriendProfile> | undefined;
json_params?: Array<FriendProfile> | undefined;
user_data?: string | undefined;
}
Return value details
name | type | description |
---|---|---|
code | TIMResult | TIMErrCode | Request result: Error codes. 0 means success. |
desc | string | undefined | The description of the error. It will be empty if success. |
json_param | Array< FriendProfile > | undefined | Return value of calling API |
json_params | Array< FriendProfile > | undefined | Return value of calling API. Compatible field, which is returned in some cases. |
user_data | string | undefined | ImSDK is responsible for transporting user-defined data without any processing |
Code example
import TimRender from "im_electron_sdk/dist/renderer";
const timRenderInstance = new TimRender();
import { GetFriendProfileListParams } from "im_electron_sdk/dist/interfaces";
let param: GetFriendProfileListParams = {
user_data: "123" // optional
}
const { code } = await timRenderInstance.TIMFriendshipGetFriendProfileList(param);
if (code == 0) {
// success
}