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) {
markFriendUpdateSubmitted();
}
@Override
public void onError(int code, String error) {
recordFriendUpdateFailure(code, 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, replaced as a complete value. |
A successful callback means the update request completed. Merge the friend increment through onFriendInfoChanged, as documented in Get the friend list by page.
Was this page helpful?