SDKsAndroid
Refuse a friend application
Decline a friend request from a specified user with an optional rejection reason using refuseFriendApplication().
Decline an incoming friend request from a specified user with an optional reason note.
Code example
OpenIMClient.getInstance().friendshipManager.refuseFriendApplication(
new OnBase<String>() {
@Override
public void onSuccess(String data) {
// Friend application rejected successfully
}
@Override
public void onError(int code, String error) {
// Handle error
}
},
applicantUserID,
"Declined for now"
);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
base | OnBase<String> | Yes | Callback delivering the asynchronous operation result. |
applicantUserID | String | Yes | User ID of the applicant who submitted the request. |
handleMsg | String | No | Optional rejection explanation note. |
Return value
The successful callback indicates that the server recorded the rejection status.
State changes after the call
Upon rejection, the SDK dispatches the onFriendApplicationRejected(FriendApplicationInfo application) event via OnFriendshipListener. Locate the matching entry in your received requests list using application.getFromUserID() and update its status to rejected.
For complete listener registration details, see Get received friend applications.
Was this page helpful?