SDKsWASM
Update friend information
Update friend remarks, pinning state, or extension data.
updateFriends() applies the same set of fields to every friend in friendUserIDs.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
friendUserIDs | string[] | Yes | User IDs of the friends to update. |
remark | string | No | New remark. |
isPinned | boolean | No | Whether to pin the friends. |
ex | string | No | New extension string. It completely replaces the previous value. |
In addition to friendUserIDs, pass at least one field that actually needs to be updated.
await openimsdk.updateFriends({
friendUserIDs: [friendUserID],
remark: remark.trim(),
isPinned: true,
});Call the method separately when different friends need different values. ex is a complete string and does not merge JSON fields automatically.
A successful Promise means that the update request has completed. When OnFriendInfoChanged arrives, use its userID to update the matching friend. See Get the friend list for the complete listener.
Was this page helpful?