SDKsAndroid
Update friend profiles
Use updateFriendsReq() to update friend remarks, pinned state, or extension data.
UpdateFriendsReq request = new UpdateFriendsReq();
request.setFriendUserIDs(new String[] { friendUserID });
request.setRemark(remark.trim());
OpenIMClient.getInstance().friendshipManager.updateFriendsReq(
new OnBase<String>() {
@Override
public void onSuccess(String data) {
// Friend profile update succeeded.
}
@Override
public void onError(int code, String error) {
// Handle the error.
}
},
request
);UpdateFriendsReq supports friendUserIDs, remark, isPinned, and ex. One call applies the same field value to every target friend. Use separate calls when friends need different values. ex is a complete string.
| Field | Description |
|---|---|
friendUserIDs | Friend ID array to update. |
remark | Friend remark for the current account. |
isPinned | Whether to pin the friend. |
ex | Friendship extension string. |
A successful callback means the update-friends request completed. Receive friend profile changes through onFriendInfoChanged, as documented in Get the friend list by page.
Was this page helpful?