SDKsReact Native
Accept a friend request
Accept an incoming friend application to establish a mutual friendship with the OpenIM React Native SDK.
Accept an incoming friend request from a specified applicant:
await OpenIMSDK.acceptFriendApplication({
toUserID: applicantUserID,
handleMsg: '',
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
toUserID | string | Yes | User ID of the applicant who initiated the friend request. |
handleMsg | string | Yes | Optional response message attached to the approval. Pass an empty string "" if not needed. |
Return value
A resolved Promise confirms that the friend application was accepted on the server.
Accepting a friend application creates a mutual friendship, emitting OnFriendApplicationAccepted and OnFriendAdded on both clients. Keyed by userID, insert the new friend record into your local friend list and update the application record status. For event listeners, see Get friend list by page.
Was this page helpful?