SDKsiOS
Create a text message
Create a text message with OpenIM iOS SDK.
Invoke createTextMessage: on OIMMessageInfo to construct an in-memory plain text message object ready for delivery:
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
text | NSString * | Yes | Plain text body content. Handle whitespace validation and maximum character length limits before calling. |
Code example
OIMMessageInfo *message = [OIMMessageInfo createTextMessage:text];Return value
Returns an initialized OIMMessageInfo model with its content type set to plain text.
State changes after the call
- Local memory instantiation: This synchronous factory method instantiates an object in memory only. It does not save records to local storage, establish network connections, or trigger listener events.
- Subsequent dispatch: Send the message to a user or group conversation by calling Send a message.
Was this page helpful?