Browse SDKs · React Native
SDKsReact Native

Update friend information

Update friend information with the OpenIM React Native SDK.

Copy

Call updateFriends() to update every friend in friendUserIDs.

await OpenIMSDK.updateFriends({
  friendUserIDs: [friendUserID],
  remark: remark,
  isPinned: true,
});

Parameter description

ParameterTypeRequiredDescription
friendUserIDsstring[]YesFriend user IDs to update.
remarkstringNoNew remark.
isPinnedbooleanNoWhether to pin the friend.
exstringNoNew extension string.

Pass at least one field to update in addition to friendUserIDs. Call the method separately when different friends need different values. After friend information changes, OnFriendInfoChanged is emitted; see Get the friend list for the listener example.