Browse SDKs · iOS
Platform
SDKsiOS

Create an @all message

Create a message that mentions every group member with OpenIM iOS SDK.

Copy

Invoke createTextAtAllMessage:displayText:message: on OIMMessageInfo to construct a message that mentions every member of a group:

Parameters

ParameterTypeRequiredDescription
textNSString *YesThe complete message text.
displayTextNSString *YesThe display placeholder string representing all members (such as @All).
messageOIMMessageInfo * _NullableNoQuoted message reference; pass nil if not quoting.

Code example

OIMMessageInfo *message =
    [OIMMessageInfo createTextAtAllMessage:@"@All Please review the announcement"
                               displayText:@"@All"
                                   message:nil];

Return value

Returns an initialized OIMMessageInfo model configured with an all-members mention.

State changes after the call

  1. Local memory instantiation: This method builds an object in memory only. Whether the current user is authorized to send @all notifications is enforced by server policies during dispatch.
  2. Subsequent dispatch: Deliver this message to a group conversation by calling Send a message.