Within imiconnect, all In-App messages are compartmentalized into logical threads of conversation. The ICThread class is the local representation of thread data within the imiconnect SDK.

Threads can be managed via the SDK using the methods exposed by the ICMessaging class and support data attributes such as title, category, status, and extras.

Before messages can be published from the SDK a thread must be provisioned within the imiconnect platform via ICMessaging.createThread or via the web APIs.

When replying to an existing thread, obtain an ICThread instance from an incoming ICMessage or from the ICMessaging.fetchThreads method.

fromJSON

Instantiates an ICThread instance from a JSONObject. The JSONObject must contain valid thread data.

  Syntax: static ICThread fromJSON(JSONObject jsonObj)

  Return Value: A new ICThread instance. Returns null if jsonObj is null.

  Parameters:

ParameterTypeDescription
jsonObjJSONObjectA JSONObject instance containing valid thread data.

getCategory

Gets the thread category.

  Syntax: String getCategory()

  Return Value: The thread category.

getCreatedAt

Gets the date on which the thread was created within the imiconnect platform.

  Syntax: Date getCreatedAt()

  Return Value: The thread creation date.

getExternalId

Gets the external id associated with the thread. An external id is a value that may be used to associate the thread with an entity in an external system.

  Syntax: String getExternalId()

  Return Value: The external id, if present, otherwise null.

getExtras

Returns a bundle of any extra data associated with the thread. Extras may be used to associate custom data with a thread.

  Syntax: Bundle getExtras()

  Return Value: Extra data elements associated to the thread, or null if none exists.

getId

Gets the unique identifier of the thread. This value is generated by the imiconnect platform when the thread is provisioned.

  Syntax: String getId()

  Return Value: The thread id.

getStatus

Returns the status of the thread. See ICThreadStatus for possible values.

  Syntax: ICThreadStatusgetStatus()

  Return Value: The threads current status.

getTitle

Returns the title of the thread.

  Syntax: String getTitle()

  Return Value: The thread title.

getType

Returns the type of thread. See ICThreadType for possible options.

  Syntax: ICThreadType getType()

  Return Value: Returns the thread type.

getUpdatedAt

Returns the date on which the thread was last updated. Changes to thread data, or publication of messages on the thread, will affect this date.

  Syntax: Date getUpdatedAt()

  Return Value: The date the thread was last updated.

setCategory

Sets the category thread.

  Syntax: void setCategory(String category)

  Parameters:

ParameterTypeDescription
categoryStringCategory of the thread.

setExternalId

Sets the external id value. External ids can be used to associate a thread with an entity in an external system.

  Syntax: void setExternalId(String externalId)

  Parameters:

ParameterTypeDescription
externalIdStringThe external id value

setExtras

Sets extra data to be associated with the thread.

  Syntax: void setExtras(Bundle extras)

  *Parameters:

ParameterTypeDescription
ExtrasBundleThe extra data

setTitle

Sets the thread title.

  Syntax: void setTitle(String title)
cx
Parameters:

ParameterTypeDescription
titleStringTitle of the thread.

toJSON

Returns a JSON representation of the thread.

  Syntax: JSONObject toJSON()

  Return Value: Thread data as a JSONObject