SDKsAndroid
Accept a friend request
Use acceptFriendApplication() to accept a friend request.
OpenIMClient.getInstance().friendshipManager.acceptFriendApplication(
new OnBase<String>() {
@Override
public void onSuccess(String data) {
markApplicationAccepted(applicantUserID);
}
@Override
public void onError(int code, String error) {
recordApplicationAcceptFailure(code, error);
}
},
applicantUserID,
"Accepted"
);applicantUserID identifies the applicant, and the final argument is the handling message. A successful callback means the accept request completed. The request state and new friendship can arrive through separate callbacks and should be merged independently: onFriendApplicationAccepted updates the application and onFriendAdded updates the friendship.
Was this page helpful?