Browse SDKs · iOS
SDKsiOS

Delete all messages from a user in a group chat

Delete every message sent by a specified user in a group chat with OpenIM iOS SDK.

Copy
[[OIMManager manager] deleteUserAllMessagesInConversation:conversationID
    userID:targetUserID
    onSuccess:nil
    onFailure:nil];

This selector is for group chats only. It deletes all messages sent by the specified user in the target group conversation. This is a group-administration or content-moderation operation, and the server validates the operator's permissions. Do not infer the affected message IDs from a successful callback.

This page owns onDeleteUserAllMsgsInConv:. Its payload contains only conversationID and userID; clear the matching cache and query history again. For the listener lifecycle, see Receive messages.