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:

Parameter

Type

Description

jsonObj

JSONObject

A JSONObject instance containing valid thread data.


Gets the thread category.

  Syntax: String getCategory()

  Return Value: The thread category.


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.


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.


Returns the status of the thread. See [ICThreadStatus](https://developers.imiconnect.io/docs/enumerations-2#section-icthreadstatus) for possible values.

  Syntax: [ICThreadStatus](https://developers.imiconnect.io/docs/enumerations-2#section-icthreadstatus)getStatus()

  Return Value: The threads current status.


Returns the title of the thread.

  Syntax: String getTitle()

  Return Value: The thread title.


Returns the type of thread. See [ICThreadType](https://developers.imiconnect.io/docs/enumerations-2#section-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.


Sets the category thread.

  Syntax: void setCategory(String category)

  Parameters:

Parameter

Type

Description

category

String

Category 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:

Parameter

Type

Description

externalId

String

The external id value

setExtras

Sets extra data to be associated with the thread.

  Syntax: void setExtras(Bundle extras)

  *Parameters:

Parameter

Type

Description

Extras

Bundle

The extra data

setTitle


Sets the thread title.

  Syntax: void setTitle(String title)
cx
Parameters:

Parameter

Type

Description

title

String

Title of the thread.


Returns a JSON representation of the thread.

  Syntax: JSONObject toJSON()

  Return Value: Thread data as a JSONObject