Browse SDKs · React Native
SDKsReact Native

Add a user to the blacklist

Block a user with the OpenIM React Native SDK.

Copy

Call addBlack() to add a specified user to the current account's blocklist.

await OpenIMSDK.addBlack({
  toUserID,
  ex,
});

Parameter description

ParameterTypeRequiredDescription
toUserIDstringYesUser ID to block.
exstringNoBlocklist relationship extension information.

After the user is blocked, OnBlackAdded is emitted. See Get the blocklist for the blocklist and listener example.