Avaya Client Services API Reference (iOS)

- Main Page
- Classes
- Files
- Related Pages

- Class List
- Class Index
- Class Hierarchy
- Class Members

Instance Methods | Properties | List of all members
CSMessage Class Reference

Interface for all Message related tasks and properties. More...

`#import <CSMessage.h>`

Inherits NSObject.

## Instance Methods
(void) | - sendWithCompletionHandler:
| Invokes a send request for this message. More...
(void) | - setBodyAndReportTyping:completionHandler:
| Sets the body of the draft message and the "is typing" chat state. More...
(void) | - reportTyping:
| Sets or clears the "is typing" chat state. More...
(void) | - setInReplyTo:completionHandler:
| Sets the in-reply-to message for draft message. More...
(void) | - getInReplyToMessageWithCompletionHandler:
| Gets the in-reply-to message of this message. More...
(void) | - getDeliveryDetailsWithCompletionHandler:
| Gets MessageDeliveryDetails or error. More...
(void) | - setDoNotForward:completionHandler:
| Sets the do-not-forward state for the message. More...
(void) | - setImportance:completionHandler:
| Sets the importance of the message. More...
(void) | - markAsRead
| Marks this message as read. More...
(CSMessagingAttachment *) | - createAttachment
| Creates a CSMessagingAttachment for this message. More...
(void) | - removeAttachment:completionHandler:
| Removes a specified attachment from this message. More...

## Properties
id< CSMessageDelegate > | delegate
| The delegate responsible for handling message-related events. More...
NSString * | messageId
| The unique message identifier. More...
NSString * | providerMessageId
| This is the message ID from the underlying provider (e.g., the AMM server) as-is. More...
CSMessagingType | type
| The message type. More...
CSMessagingReasonType | reasonType
| Message reason type (specific to CSMessagingTypeClosed and CSMessagingTypeLeft message types) More...
CSMessagingProviderType | providerType
| The messaging provider type (AMM, Zang). More...
CSMessagingMessageStatus | status
| The message status. More...
NSString * | subject
| The subject of the conversation at the time the message was sent. More...
NSString * | body
| The body of the message. More...
NSString * | htmlBody
| * The HTML body of the message. More...
BOOL | hasHtmlBody
| Flag indicating if the message contains HTML body. More...
NSString * | conversationId
| The unique identifier of the conversation to which this message belongs. More...
NSDate * | lastModifiedDate
| The date and time that the message was last modified. More...
NSDate * | receivedDate
| The date and time that the message was received. More...
BOOL | coalesced
| Returns the coalesced status of the message, which is defining if two consecutive messages can be merged. More...
BOOL | fromMe
| A Boolean value indicating whether the current user is the sender of the message. More...
BOOL | hasAttachment
| A Boolean value indicating if the message has one or more attachments. More...
BOOL | hasUnreadAttachment
| A Boolean value indicating if the message has a least one attachment that has not been viewed. More...
BOOL | hasInReplyTo
| A Boolean value indicating if the message has an in-reply-to message (does not mean it is in cache). More...
BOOL | privateMessage
| A Boolean value indicating if the message is marked as a private message. More...
BOOL | doNotForward
| The do-not-forward status of the message, which indicates if the sender of this message had disallowed forwarding of this particular message. More...
BOOL | read
| A Boolean value indicating if the message has been read. More...
CSMessagingMessageReadState | readState
| Get message Read state. More...
CSMessagingMessageDeliveryState | deliveryState
| The message delivery state describing whether this message is sent or delivered to one or more recipients. More...
CSMessagingParticipant * | fromParticipant
| The participant who sent the message. More...
NSArray * | attachments
| The attachments for this message. More...
CSMessagingImportance | importance
| The message importance. More...
CSMessagingSensitivityLevel | sensitivity
| The message sensitivity. More...
NSArray * | addedParticipants
| When the message type is CSMessagingTypeJoined, this property returns the list of participants that were added to the conversation. More...
NSArray * | removedParticipants
| When the message type is CSMessagingTypeLeft, this property returns the list of participants that were removed from the conversation. More...
NSArray * | recipients
| The list of participants, including the sender, that the message was sent to. More...
CSCapability * | updateBodyCapability
| Returns a CSCapability object that indicates if the body text or "is typing" status of the message can be updated. More...
CSCapability * | updateInReplyToCapability
| Returns a CSCapability object that indicates if the in-reply-to attribute of the message can be updated. More...
CSCapability * | updateDoNotForwardCapability
| Returns a CSCapability object that indicates if the DoNotForward attribute of the message can be updated. More...
CSCapability * | updateImportanceCapability
| Returns a CSCapability object that indicates if the importance attribute of the message can be updated. More...
CSCapability * | createAttachmentCapability
| Returns a CSCapability object that indicates if an attachment can be added to the message. More...
CSCapability * | sendCapability
| Returns a CSCapability object that indicates if the message can be sent. More...
CSCapability * | markAsReadCapability
| Returns a CSCapability object that indicates if the message can be marked as read. More...
CSCapability * | removeCapability
| Returns a CSCapability object that indicates if the message can be removed. More...
CSCapability * | deliveryDetailsCapability
| Returns a CSCapability object that indicates if the message can provide its delivery details. More...
CSMessagingParticipant * | initiatorParticipant
| The participant is the initiator of an event message, such as LEFT message when a participant is removed from a conversation by other participant(initiator) More...

## Detailed Description

Interface for all Message related tasks and properties.

Message is a crucial part of the conversation. It can store not only text content or attachments, but is also used to inform about any event that occurred in the conversation, like a new participant or subject change. It is important to notice that the body cannot be empty for a usual message, unless an attachment is present.

To create a new message, call the -[CSMessagingConversation createMessage] method, which will return a new object. After filling out the message and its other parameters, use the sendWithCompletionHandler: operation in order to send a message.

An important part of the message is also attachments. In order to create a new attachment in a message object, use the createAttachment method.

Besides normal messages with text body there are also messages informing about events. CSMessagingType is informing about an event type and these objects do not contain any text body. They can have some additional data about an event, i.e. addedParticipants, removedParticipants, etc.

## Method Documentation

- (CSMessagingAttachment *) createAttachment |  |  |

Creates a CSMessagingAttachment for this message.

Returns
  A new CSMessagingAttachment object for this message that is in the draft state.

See also
  createAttachmentCapability
  attachments
  - removeAttachment:completionHandler:

- (void) getDeliveryDetailsWithCompletionHandler: |  | (CSMessagingMessageDeliveryDetailsCompletionHandler) | handler |

Gets MessageDeliveryDetails or error.

Delivery details are returned via completion handler.

Parameters

  handler | The completion handler associated with this operation.

- (void) getInReplyToMessageWithCompletionHandler: |  | (CSMessagingMessageCompletionHandler) | handler |

Gets the in-reply-to message of this message.

Parameters

  handler | The completion handler associated with this operation.

- (void) markAsRead |  |  |

Marks this message as read.

- (void) removeAttachment: |  | (CSMessagingAttachment *) | attachment
completionHandler: |  | (CSMessagingCompletionHandler) | handler

Removes a specified attachment from this message.

Parameters

  attachment | The CSMessagingAttachment to remove from the message.
  handler | The completion handler associated with this operation.

- (void) reportTyping: |  | (BOOL) | typing |

Sets or clears the "is typing" chat state.

This is a "fire and forget" operation.

Parameters

  typing | YES to indicate that the user is typing, NO if not.

- (void) sendWithCompletionHandler: |  | (CSMessagingCompletionHandler) | handler |

Invokes a send request for this message.

Parameters

  handler | The completion handler for this operation.

See also
  sendCapability

- (void) setBodyAndReportTyping: |  | (NSString *) | messageBody
completionHandler: |  | (CSMessagingCompletionHandler) | handler

Sets the body of the draft message and the "is typing" chat state.

Client application having HTML capability can set messageBody with text in HTML format.

Parameters

  messageBody | The body of the message.
  handler | The completion handler associated with this operation.

- (void) setDoNotForward: |  | (BOOL) | doNotForward
completionHandler: |  | (CSMessagingCompletionHandler) | handler

Sets the do-not-forward state for the message.

Parameters

  doNotForward | The new do-not-forward status of the message.
  handler | The completion handler associated with this operation.

- (void) setImportance: |  | (CSMessagingImportance) | importance
completionHandler: |  | (CSMessagingCompletionHandler) | handler

Sets the importance of the message.

Parameters

  importance | The new importance of the message.
  handler | The completion handler associated with this operation.

- (void) setInReplyTo: |  | (CSMessage *) | inReplyToMessage
completionHandler: |  | (CSMessagingCompletionHandler) | handler

Sets the in-reply-to message for draft message.

Parameters

  inReplyToMessage | The in-reply-to message of this draft message.
  handler | The completion handler associated with this operation.

## Property Documentation

- (NSArray*) addedParticipants
| read nonatomic assign

When the message type is CSMessagingTypeJoined, this property returns the list of participants that were added to the conversation.

Property of incoming messages only.

Returns
  When the message type is CSMessagingTypeJoined, this property returns the list of participants that were added to the conversation.

See also
  type

- (NSArray*) attachments
| read nonatomic assign

The attachments for this message.

See also
  - createAttachment
  - removeAttachment:completionHandler:

- (NSString*) body
| read nonatomic assign

The body of the message.

See also
  - setBodyAndReportTyping:completionHandler:

- (BOOL) coalesced
| read nonatomic assign

Returns the coalesced status of the message, which is defining if two consecutive messages can be merged.

Message is coalesced if:

- There is a previous message.
- This and the previous message have both been published.
- This and the previous message are from the same participant.
- This and the previous message have no attachments.
- This and the previous message have the same sensitivity setting.
- This message was sent no longer than 1 minute after the previous message.
- Has the same sensitivity as previous message.
- Was sent not longer than 1 minute after previous message.

Returns
  The coalesced status of the message.

Deprecated:
  THIS SELECTOR WILL BE REMOVED IN RELEASE VERSION 3.3.

- (NSString*) conversationId
| read nonatomic assign

The unique identifier of the conversation to which this message belongs.

See also
  CSMessagingConversation::conversationId

- (CSCapability*) createAttachmentCapability
| read nonatomic assign

Returns a CSCapability object that indicates if an attachment can be added to the message.

This capability is Allowed when the Message has not yet been sent, or a send failure has occurred.

Returns
  A CSCapability object that indicates if an attachment can be added to the message.

See also
  - createAttachment

- (id<CSMessageDelegate>) delegate
| read write nonatomic weak

The delegate responsible for handling message-related events.

- (CSCapability*) deliveryDetailsCapability
| read nonatomic assign

Returns a CSCapability object that indicates if the message can provide its delivery details.

Returns
  A CSCapability object that indicates if the message can provide its delivery details.

- (CSMessagingMessageDeliveryState) deliveryState
| read nonatomic assign

The message delivery state describing whether this message is sent or delivered to one or more recipients.

Delivery state will not update from Sent to Delivered in case MessageDeliveryReadStateMonitoring is disabled or not supported by messaging server.

Returns
  Delivery state (eg. Unsent, Sent, Delivered).

See also
  CSMessagingMessageDeliveryState
  CSMessagingConversation::messageDeliveryStateCapability

- (BOOL) doNotForward
| read nonatomic assign

The do-not-forward status of the message, which indicates if the sender of this message had disallowed forwarding of this particular message.

- (BOOL) fromMe
| read nonatomic assign

A Boolean value indicating whether the current user is the sender of the message.

- (CSMessagingParticipant*) fromParticipant
| read nonatomic assign

The participant who sent the message.

See also
  recipients

- (BOOL) hasAttachment
| read nonatomic assign

A Boolean value indicating if the message has one or more attachments.

See also
  attachments
  - createAttachment
  - removeAttachment:completionHandler:

- (BOOL) hasHtmlBody
| read nonatomic assign

Flag indicating if the message contains HTML body.

See also
  htmlBody

- (BOOL) hasInReplyTo
| read nonatomic assign

A Boolean value indicating if the message has an in-reply-to message (does not mean it is in cache).

- (BOOL) hasUnreadAttachment
| read nonatomic assign

A Boolean value indicating if the message has a least one attachment that has not been viewed.

See also
  attachments

- (NSString*) htmlBody
| read nonatomic assign

* The HTML body of the message.

* *

See also
  hasHtmlBody *
  - setBodyAndReportTyping:completionHandler:

- (CSMessagingImportance) importance
| read nonatomic assign

The message importance.

- (CSMessagingParticipant*) initiatorParticipant
| read nonatomic assign

The participant is the initiator of an event message, such as LEFT message when a participant is removed from a conversation by other participant(initiator)

- (NSDate*) lastModifiedDate
| read nonatomic assign

The date and time that the message was last modified.

- (CSCapability*) markAsReadCapability
| read nonatomic assign

Returns a CSCapability object that indicates if the message can be marked as read.

This capability is Allowed when all of the following conditions are true:

- The messaging service is online (has an active connection to the server).
- The messaging server supports marking messages as read.
- The Message is in the published state or the conversation of which the message is a part is inactive.

Returns
  A CSCapability object that indicates whether the message can be marked as read.

See also
  - markAsRead:

- (NSString*) messageId
| read nonatomic assign

The unique message identifier.

- (BOOL) privateMessage
| read nonatomic assign

A Boolean value indicating if the message is marked as a private message.

See also
  sensitivity

- (NSString*) providerMessageId
| read nonatomic assign

This is the message ID from the underlying provider (e.g., the AMM server) as-is.

It will be consistent across clients and application launches, but is only guaranteed to be unique for messages of that provider type. It will be empty for draft message.

- (CSMessagingProviderType) providerType
| read nonatomic assign

The messaging provider type (AMM, Zang).

- (BOOL) read
| read nonatomic assign

A Boolean value indicating if the message has been read.

See also
  - markAsRead
  - markAllContentAsReadWithCompletionHandler: (CSMessagingConversation)

Deprecated:
  This method is deprecated. Use ReadState instead.

- (CSMessagingMessageReadState) readState
| read nonatomic assign

Get message Read state.

Returns
  Read state (eg. Unknown, NotRead, Read, PartiallyRead)

See also
  CSMessagingMessageReadState
  CSMessagingConversation::messageReadStateCapability

- (CSMessagingReasonType) reasonType
| read nonatomic assign

Message reason type (specific to CSMessagingTypeClosed and CSMessagingTypeLeft message types)

CSMessagingTypeClosed: Reason type of conversation close event.

- CSMessagingReasonTypeManual: The conversation was closed by participant.
- CSMessagingReasonTypeAuto: The conversation was closed by the system (e.g. auto-closed after 30 days of inactivity).

CSMessagingTypeLeft: Reason type of participants leave event.

- CSMessagingReasonTypeManual: Participant left on their own.
- CSMessagingReasonTypeAuto: There was some problem to communicate external user (user does not exist, or unavailable, or some other error). Such leave reason should display an error message like "[username] is unreachable/unable to join" rather than regular "[username] left the conversation".

- (NSDate*) receivedDate
| read nonatomic assign

The date and time that the message was received.

- (NSArray*) recipients
| read nonatomic assign

The list of participants, including the sender, that the message was sent to.

Property of incoming messages only.

Returns
  The list of CSMessagingParticipants, including the sender, that the message was sent to.

See also
  fromParticipant
  fromMe

- (CSCapability*) removeCapability
| read nonatomic assign

Returns a CSCapability object that indicates if the message can be removed.

This capability is Allowed when the Message has not yet been sent, or a send failure has occurred.

Returns
  A CSCapability object that indicates if the message can be removed.

See also
  - removeMessage:completionHandler: (CSMessagingConversation)

- (NSArray*) removedParticipants
| read nonatomic assign

When the message type is CSMessagingTypeLeft, this property returns the list of participants that were removed from the conversation.

Property of incoming messages only.

Returns
  When the message type is CSMessagingTypeLeft, this property returns the list of participants that were removed from the conversation.

See also
  type

- (CSCapability*) sendCapability
| read nonatomic assign

Returns a CSCapability object that indicates if the message can be sent.

This capability is Allowed when all of the following conditions are true:

- The messaging service is online (has an active connection to the server).
- The message has not yet been sent, or a send failure has occurred.
- The message has no body text or the messaging server supports the sending of messages containing text.
- The message has body text whose length does not exceed the maximum text length set on the messaging server.
- The message has no attachments or the messaging server supports the sending of messages having attachments.
- The message has no "thumbnail" attachments or the messaging server supports the sending of messages having "thumbnail" attachments.

Returns
  A CSCapability object that indicates whether the message can be sent.

See also
  - sendWithCompletionHandler:

- (CSMessagingSensitivityLevel) sensitivity
| read nonatomic assign

The message sensitivity.

- (CSMessagingMessageStatus) status
| read nonatomic assign

The message status.

- (NSString*) subject
| read nonatomic assign

The subject of the conversation at the time the message was sent.

See also
  CSMessagingConversation::subject

- (CSMessagingType) type
| read nonatomic assign

The message type.

- (CSCapability*) updateBodyCapability
| read nonatomic assign

Returns a CSCapability object that indicates if the body text or "is typing" status of the message can be updated.

This capability is Allowed when the message has not yet been sent, or a send failure has occurred.

Returns
  A CSCapability object that indicates if the body text or "is typing" status of the message can be updated.

See also
  - setBodyAndReportTyping:completionHandler:
  - reportTyping:

- (CSCapability*) updateDoNotForwardCapability
| read nonatomic assign

Returns a CSCapability object that indicates if the DoNotForward attribute of the message can be updated.

This capability is Allowed when the Message has not yet been sent, or a send failure has occurred.

Returns
  A CSCapability object that indicates if the DoNotForward attribute of the message can be updated.

See also
  - setDoNotForward:completionHandler:

- (CSCapability*) updateImportanceCapability
| read nonatomic assign

Returns a CSCapability object that indicates if the importance attribute of the message can be updated.

This capability is Allowed when the message has not yet been sent, or a send failure has occurred.

Returns
  A CSCapability object that indicates if the Importance attribute of the message can be updated.

See also
  - setImportance:completionHandler:

- (CSCapability*) updateInReplyToCapability
| read nonatomic assign

Returns a CSCapability object that indicates if the in-reply-to attribute of the message can be updated.

This capability is Allowed when the CSMessage has not yet been sent, or a send failure has occurred.

Returns
  A CSCapability object that indicates if the in-reply-to attribute of the message can be updated.

See also
  - setInReplyTo:completionHandler:

The documentation for this class was generated from the following file:

- CSMessage.h