ICButton

This class exposes the data related to interactive button in quick replies and generic templates.

getIdentifier

This method is used to get the Identifier of the Button .

Syntax: String getIdentifier()

Return Value: Returns the Identifier of the Button.

setIdentifier

This method is used to set the Identifier of the Button .

Syntax: void setIdentifier (String identifier)

Parameter:

ParameterTypeDescription
identifierStringThe Identifier of the Button

getTitle

This method is used to get the title of the Button .

Syntax: String getTitle()

Return Value: Returns the title of the Button.

setTitle

This method is used to set the title of the Button .

Syntax: void setTitle(String title)

Parameter:

ParameterTypeDescription
titleStringThe title of the Button

getType

This method is used to get the type of the Interactive Data .

Syntax: String getType()

Return Value: Returns the type of the Interactive Data.

setType

This method is used to set the type of the Interactive Data .

Syntax: void setType(String type)

Parameters:

ParameterTypeDescription
typeStringThe Type of the Interactive Data

getActionURL

This method is used to get the ActionURL, The url that can be used to open web_link and deep link.

Syntax: String getActionURL ()

Return Value: Returns the ActionURL of the Button.

setActionURL

This method is used to set the ActionURL of the Button .

Syntax: void setActionURL (String actionURL)

Parameter:

ParameterTypeDescription
actionURLStringThe url that can be used to open web_link and deeplink.

getImageURL

This method is used to get the Image URL, The url that can be used to render the image of the Button.

Syntax: String getImageURL ()

Return Value: Returns the Image URL of the Button.

setImageURL

This method is used to set the Image URL of the Button .

Syntax: void setImageURL (String imageURL)

Parameter:

ParameterTypeDescription
imageURLStringThe url that can be used to render the image of the Button.

getPayload

This method is used to get the payload of the Button.

Syntax: JSONObject getPayload ()

Return Value: Returns the payload of the Button.

setPayload

This method is used to set the payload of the Button.

Syntax: void setPayload (JSONObject payload)

Parameter:

ParameterTypeDescription
payloadJSONObjectThe payload of the button.

toJSON

This method returns the JSONObject containing the button data.

Syntax: JSONObject toJSON ()

Return Value: Returns JSONObject representation of the Button.

fromJSON

Instantiates a new ICButton instance from the supplied JSONObject.

Syntax: ICButton fromJSON (JSONObject jsonObject)

Parameter:

ParameterTypeDescription
jsonObjectJSONObjectA valid JSONObject instance containing button data.

Return Value: Returns A new ICButton or null if jsonObject is null.