Browse SDKs · HarmonyOS
Platform
SDKsHarmonyOSEnterprise

Remove user from blocklist

Unblock a previously blocked user from the current account’s blocklist.

Copy

Remove a user from the active blocklist:

Code example

import sdk, { DeleteBlackReq } from '@openimsdk/imsdk';

const request: DeleteBlackReq = {
  userID: targetUserID,
};
await sdk.deleteBlack(request);

Parameters

ParameterTypeRequiredDescription
userIDstringYesTarget user identifier to unblock.

Return value

Returns a Promise that resolves to void upon unblocking on the server.

State changes after the call

Unblocking a user does not automatically restore a friendship if it was previously severed. Once the Promise resolves, update your local blocklist store by removing the record matched on blockUserID (matching target userID) when EventOnBlackDeleted arrives, or re-query via Retrieve blocklist.