AgoraRtmMessage Class Reference

Inherits from NSObject
Declared in AgoraRtmKit.h

Overview

Attributes of a peer-to-peer or channel text message.

  type

Agora RTM message type. See AgoraRtmMessageType. Text messages only.

@property (nonatomic, assign, readonly) AgoraRtmMessageType type

Declared In

AgoraRtmKit.h

  text

Agora RTM message content. Must not exceed 32 KB in length.

@property (nonatomic, copy, nonnull) NSString *text

Declared In

AgoraRtmKit.h

  serverReceivedTs

The timestamp (ms) of when the messaging server receives this message.

@property (nonatomic, assign, readonly) long long serverReceivedTs

Discussion

NOTE

  • You can infer from the returned timestamp the approximate time as to when this message was sent.
  • The returned timestamp is on a millisecond time-scale. It is for demonstration purposes only, not for strict ordering of messages.

Declared In

AgoraRtmKit.h

  isOfflineMessage

Whether this message has been cached on the server (Applies to peer-to-peer message only).

@property (nonatomic, assign, readonly) BOOL isOfflineMessage

Discussion

  • YES: This message has been cached on the server (the server caches this message and resends it to the receiver when he/she is back online).
  • NO: (Default) This message has not been cached on the server.

NOTE

  • This method returns NO if a message is not cached by the server. Only if the sender sends the message as an offline message (sets enableOfflineMessaging as YES) when the specified user is offline, does the method return YES when the user is back online.
  • For now we only cache 200 offline messages for up to seven days for each message receiver. When the number of the cached messages reaches this limit, the newest message overrides the oldest one.
  • Declared In

    AgoraRtmKit.h

    – initWithText:

    Creates and initializes a text message to be sent.

    - (instancetype _Nonnull)initWithText:(NSString *_Nonnull)text

    Parameters

    text

    A text message of less than 32 KB.

    Return Value

    An AgoraRtmMessage instance.

    Declared In

    AgoraRtmKit.h