This class provides a concrete implementation of the ICMessageData interface to express In-App and Push channels in a generalized form and is used when receiving messages to or sending messages from the SDK. In addition to the class-specific methods listed below, reference the ICMessageData class for interface method details.

fromJSON

Returns an ICMessage instance from a JSONObject. The JSONObject must contain valid ICMessage data.

Syntax: static ICMessage fromJSON(JSONObject jsonObj)

Return Value: An ICMessage instance or null if the jsonObj parameter was null.

getMedia

Deprecated - Use getAttachments instead.

Returns any media files that are attached to the message.

Syntax: ICMediaFile[] getMedia()

Return Value: Returns the media files that were attached to the message or null if no media file attachments exist.

getTitle

Gets the message title, if present.

Syntax: String getTitle()

Return Value: Returns message title if present.

setAttachments

Used to set the attachments which will be sent with an outgoing message.

Syntax: setAttachments(final ICAttachment[] attachments)

Parameters:

ParameterTypeDescription
attachmentsICAttachment[]The attachments to attach to the message.

setCustomTags

This method is used to set the custom tags bundle to be sent with an outgoing Live Chat / In-App Messaging. This method is not applicable to Push messaging.

Syntax: void setCustomTags(Bundle tags)

Parameters:

ParameterTypeDescription
tagsBundleSpecifies the Android bundle.

getCustomTags

This method is used to return any custom tag data that was sent as part of the message.

Syntax: Bundle getCustomTags()

Returns: Returns the data that was sent as part of the message payload.

setDeliveredAt

Sets the date on which the message is considered delivered to the device.

The SDK sets the delivered status automatically when a message is received, there should be no need to call this method manually.

Syntax: void setDeliveredAt(Date date)

Parameters:

ParameterTypeDescription
dateDateThe date on which the message is considered as delivered.

setMedia

Deprecated - Use setAttachments instead.

Attaches the specified media files to the message.

Syntax: void setMedia(ICMediaFile[] files)

Parameters:

ParameterTypeDescription
filesICMediaFileThe media file array to attach to the message

setMessage

Used to set the textual part of the message.

Syntax: void setMessage(String message)

Parameters:

ParameterTypeDescription
messageStringSpecifies the text content of the message.

setReadAt

Sets the date on which the message was considered as Read.

Syntax: void setReadAt(Date date)

Parameters:

ParameterTypeDescription
dateDateThe date on which the message was considered as read.

setStatus

Sets the status of the message.

This method has limited use as message status is generally inferred based on delivered and read at dates. i.e. a message with a read at date is considered to be in the Read status.

Syntax: void setStatus(ICMessageStatus status)

Parameters:

ParameterTypeDescription
statusICMessageStatusThe new message status

getStatus

Returns the current status of the message (None/Sent/NotSent/Delivered/Read)

Syntax: ICMessageStatusgetStatus()

Return Value: Returns the current status of the message.

getSubmittedAt

Returns the date on which the message was submitted to the Webex Connect platform.

Syntax: Date getSubmittedAt()

Return Value: Message submission date.

setThread

Sets the thread instance to which the message belongs.

A valid thread instance must be assigned to a message before it can be published.

When replying to an existing thread, obtain the thread instance from an existing incoming message or from fetchMessages.

When publishing to a new thread, instantiate a new ICThread instance and use createThread to provision the thread within the Webex Connect platform before attempting to publish.

Syntax: void setThread(ICThread thread)

Parameters:

ParameterTypeDescription
threadICThreadThe thread object to which the message should belong.

getThread

Returns an ICThread instance representing the thread to which the message belongs.

Syntax: ICThread getThread()

Return Value: The ICThread to which the message belongs.

getTransactionId

Gets the transaction id that uniquely identifies the message within the Webex Connect platform.

Syntax: String getTransactionId()

Return Value: Returns the transaction id that identifies the message.

toJSON

Returns a JSON representation of the message.

Syntax: JSONObject toJSON()

Return Value: Message data as a JSONObject

getQuickReplyData

This method is used to return ICQuickReplyData instance that was sent as part of the message.

Syntax:  ICQuickReplyData getQuickReplyData()

Return Value: ICQuickReplyData instance.

getAttachments

This method is used to get the attachment files that are attached to the message.

Syntax: ICAttachment[] getAttachments()

Return Type: Returns the attachment files attached to the message.

getCategory

This method is used to get the category of the interactive message.

Syntax: String getCategory()

Return Value: Returns the category of the message.

getChannel

This method is used to get the channel on which the message was received.

Syntax: ICMessageChannel getChannel()

Return Value: Returns the channel.

getCreatedAt

This method is used to get the message created date on the Webex Connect platform.

Syntax: Date getCreatedAt()

Return Value: Returns the message created date on the Webex Connect platform.

getDeliveredAt

This method is used to get the message delivered date to the device.

Syntax: Date getDeliveredAt()

Return Type: Returns the message delivered date to the device.

getExtras

This method is used to get the supplementary data that was sent as part of the message payload. The format of this data is controlled by the Webex Connect platform.

Syntax: Bundle getExtras()

Return Value: Returns the supplementary data that was sent along with the message payload.

getMessage

This method is used to get the content of the message that is displayed to the end-users.

Syntax: String getMessage()

Return Value: Returns the text message that is displayed to the end-users.

isOutgoing

This method is used to determine if the message is mobile originated if the value is true.

Syntax: boolean isOutgoing()

Return Value: Returns true if the message is mobile originated, otherwise false.

getPriority

This method is used to get the priority set on the Push notification

Syntax: int getPriority();

Return Value: Returns priority set on the Push notification.

getReference

This method is used to return a reference for the message data.

Syntax:String getReference()

Return Value: Reference for the message data.

getRelatedTransactionId

This method is used to return related transaction id for the message.

Syntax:  String getRelatedTransactionId()

Return Value: Related transaction id.

getType

Returns the type of message. See ICMessageType for possible options.

Syntax: ICMessageType getType()

Return Value: Returns the message type.

getInteractiveData

This method is used to return the interactive data associated with the message.

Syntax: ICInteractiveData getInteractiveData()

Return Value: Returns the interactive data associated with the message.

getUserId()

This method is used to return the user ID associated with the message.

Syntax: String getUserId()

Return Value: Returns the user ID associated with the message.

getInAppNotificationDisplay

The display options of the push message.

Syntax: ICInAppNotificationDisplay getInAppNotificationDisplay()

Return Value: Returns the display options of the push message.