Send a friend application
Send a friend application to a selected user.
When sending a friend application, set toUserID to the recipient's user ID and reqMsg to the verification message included with the application. Before submitting, avoid sending an application to the current user or repeatedly applying to an existing friend.
await openimsdk.addFriend({ toUserID, reqMsg });Pass an empty string when there is no verification message. When the Promise resolves, the server has accepted the application request; the recipient has not necessarily approved it, so do not add the user to the friend list yet. Update application state from friend-application events, and update the friendship from OnFriendAdded after the recipient accepts. For the complete handling flow, see Get sent friend applications.
Was this page helpful?