Browse SDKs · Flutter
Platform
SDKsFlutter

Refuse a friend application

Decline an incoming friend application using the OpenIM Flutter SDK.

Copy

Decline a friend application sent by another user with an optional refusal remark:

Parameters

ParameterTypeRequiredDescription
userIDStringYesUser ID of the applicant who submitted the friend request.
handleMsgStringNoOptional remark explaining the reason for declining.

Code example

await OpenIM.iMManager.friendshipManager.refuseFriendApplication(
  userID: applicantUserID,
  handleMsg: 'Declined for now',
);

Return value

A successful Future indicates that the server has processed and recorded the application rejection.

State changes after the call

Upon success, update the applicant's record to rejected using their userID as the key. Connected devices receive friend application update events. For complete application status listening and state merging logic, see Get friend application list as recipient.