Avaya Client Services API Reference (iOS)
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< CSMessageDelegatedelegate
 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...
 
CSMessagingParticipantfromParticipant
 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...
 
CSCapabilityupdateBodyCapability
 Returns a CSCapability object that indicates if the body text or "is typing" status of the message can be updated. More...
 
CSCapabilityupdateInReplyToCapability
 Returns a CSCapability object that indicates if the in-reply-to attribute of the message can be updated. More...
 
CSCapabilityupdateDoNotForwardCapability
 Returns a CSCapability object that indicates if the DoNotForward attribute of the message can be updated. More...
 
CSCapabilityupdateImportanceCapability
 Returns a CSCapability object that indicates if the importance attribute of the message can be updated. More...
 
CSCapabilitycreateAttachmentCapability
 Returns a CSCapability object that indicates if an attachment can be added to the message. More...
 
CSCapabilitysendCapability
 Returns a CSCapability object that indicates if the message can be sent. More...
 
CSCapabilitymarkAsReadCapability
 Returns a CSCapability object that indicates if the message can be marked as read. More...
 
CSCapabilityremoveCapability
 Returns a CSCapability object that indicates if the message can be removed. More...
 
CSCapabilitydeliveryDetailsCapability
 Returns a CSCapability object that indicates if the message can provide its delivery details. More...
 
CSMessagingParticipantinitiatorParticipant
 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
handlerThe completion handler associated with this operation.
- (void) getInReplyToMessageWithCompletionHandler: (CSMessagingMessageCompletionHandler handler

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

Parameters
handlerThe 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
attachmentThe CSMessagingAttachment to remove from the message.
handlerThe 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
typingYES to indicate that the user is typing, NO if not.
- (void) sendWithCompletionHandler: (CSMessagingCompletionHandler handler

Invokes a send request for this message.

Parameters
handlerThe 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
messageBodyThe body of the message.
handlerThe completion handler associated with this operation.
- (void) setDoNotForward: (BOOL)  doNotForward
completionHandler: (CSMessagingCompletionHandler handler 

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

Parameters
doNotForwardThe new do-not-forward status of the message.
handlerThe completion handler associated with this operation.
- (void) setImportance: (CSMessagingImportance importance
completionHandler: (CSMessagingCompletionHandler handler 

Sets the importance of the message.

Parameters
importanceThe new importance of the message.
handlerThe completion handler associated with this operation.
- (void) setInReplyTo: (CSMessage *)  inReplyToMessage
completionHandler: (CSMessagingCompletionHandler handler 

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

Parameters
inReplyToMessageThe in-reply-to message of this draft message.
handlerThe completion handler associated with this operation.

Property Documentation

- (NSArray*) addedParticipants
readnonatomicassign

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
readnonatomicassign

The attachments for this message.

See also
- createAttachment
- removeAttachment:completionHandler:
- (NSString*) body
readnonatomicassign

The body of the message.

See also
- setBodyAndReportTyping:completionHandler:
- (BOOL) coalesced
readnonatomicassign

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
readnonatomicassign

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

See also
CSMessagingConversation::conversationId
- (CSCapability*) createAttachmentCapability
readnonatomicassign

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
readwritenonatomicweak

The delegate responsible for handling message-related events.

- (CSCapability*) deliveryDetailsCapability
readnonatomicassign

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
readnonatomicassign

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
readnonatomicassign

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
readnonatomicassign

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

- (CSMessagingParticipant*) fromParticipant
readnonatomicassign

The participant who sent the message.

See also
recipients
- (BOOL) hasAttachment
readnonatomicassign

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

See also
attachments
- createAttachment
- removeAttachment:completionHandler:
- (BOOL) hasHtmlBody
readnonatomicassign

Flag indicating if the message contains HTML body.

See also
htmlBody
- (BOOL) hasInReplyTo
readnonatomicassign

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

- (BOOL) hasUnreadAttachment
readnonatomicassign

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

See also
attachments
- (NSString*) htmlBody
readnonatomicassign

 * The HTML body of the message.

 *  *

See also
hasHtmlBody  *
- setBodyAndReportTyping:completionHandler:  
- (CSMessagingImportance) importance
readnonatomicassign

The message importance.

- (CSMessagingParticipant*) initiatorParticipant
readnonatomicassign

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
readnonatomicassign

The date and time that the message was last modified.

- (CSCapability*) markAsReadCapability
readnonatomicassign

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
readnonatomicassign

The unique message identifier.

- (BOOL) privateMessage
readnonatomicassign

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

See also
sensitivity
- (NSString*) providerMessageId
readnonatomicassign

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
readnonatomicassign

The messaging provider type (AMM, Zang).

- (BOOL) read
readnonatomicassign

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
readnonatomicassign

Get message Read state.

Returns
Read state (eg. Unknown, NotRead, Read, PartiallyRead)
See also
CSMessagingMessageReadState
CSMessagingConversation::messageReadStateCapability
- (CSMessagingReasonType) reasonType
readnonatomicassign

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

CSMessagingTypeClosed: Reason type of conversation close event.

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
readnonatomicassign

The date and time that the message was received.

- (NSArray*) recipients
readnonatomicassign

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
readnonatomicassign

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
readnonatomicassign

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
readnonatomicassign

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
readnonatomicassign

The message sensitivity.

- (CSMessagingMessageStatus) status
readnonatomicassign

The message status.

- (NSString*) subject
readnonatomicassign

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

See also
CSMessagingConversation::subject
- (CSMessagingType) type
readnonatomicassign

The message type.

- (CSCapability*) updateBodyCapability
readnonatomicassign

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
readnonatomicassign

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
readnonatomicassign

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
readnonatomicassign

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: