SDKsReact NativeEnterprise
Set friend request permissions
Set friend request permissions with the OpenIM React Native SDK.
addFriendPermission controls whether users who add the current account must wait for the current user to review the request. Use setSelfInfo() to update this account-level setting:
await OpenIMSDK.setSelfInfo({
addFriendPermission: AddFriendPermission.AddFriendAllowed,
});Parameter description
| Enum value | Numeric value | Description |
|---|---|---|
AddFriendPermission.AddFriendAllowed | 0 | Allow requests, but require the current user to review them. |
AddFriendPermission.AddFriendAllowedNoReview | 1 | Allow requests and establish the friendship without review. |
AddFriendPermission.AddFriendDenied | 2 | Do not allow other users to add the current account. |
This setting applies to future add-friend actions. It does not remove existing friends or automatically process pending requests. After the setting is updated, the current-user information is delivered through OnSelfInfoUpdated; see Update your profile for the listener example.
Was this page helpful?