SDKsReact Native
Add user to blacklist
Block a specified user and add them to the blacklist using the OpenIM React Native SDK.
Add a designated user to the current account's blacklist to block direct communication:
await OpenIMSDK.addBlack({
toUserID,
ex,
});Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
toUserID | string | Yes | Target user ID to blacklist. |
ex | string | No | Custom extension string attached to the blacklist record. |
Return value
A resolved Promise confirms that the user was added to the blacklist on the server.
Adding a user to the blacklist triggers the OnBlackAdded event. Use userID as the unique key to append the entry into your local blacklist cache. For event listener details, see Get blacklist.
Was this page helpful?