public static class

InAppMessage.Builder

extends Object
java.lang.Object
   ↳ com.urbanairship.iam.InAppMessage.Builder

Class Overview

In-app message builder.

Summary

Public Constructors
Builder(InAppMessage message)
Public Methods
InAppMessage.Builder addAction(String actionName, JsonValue actionValue)
Adds an action to run when the in-app message is displayed.
InAppMessage build()
Builds the in-app message.
InAppMessage.Builder setActions(Map<StringJsonValue> actions)
Sets the actions to run when the in-app message is displayed.
InAppMessage.Builder setAudience(Audience audience)
Sets the audience.
InAppMessage.Builder setDisplayContent(CustomDisplayContent displayContent)
Sets the custom display content and type.
InAppMessage.Builder setDisplayContent(BannerDisplayContent displayContent)
Sets the banner display content and type.
InAppMessage.Builder setDisplayContent(ModalDisplayContent displayContent)
Sets the modal display content and type.
InAppMessage.Builder setDisplayContent(FullScreenDisplayContent displayContent)
Sets the full screen display content and type.
InAppMessage.Builder setDisplayContent(HtmlDisplayContent displayContent)
Sets the html display content and type.
InAppMessage.Builder setExtras(JsonMap extras)
Sets the extras.
InAppMessage.Builder setId(String id)
Sets the in-app message ID.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Builder (InAppMessage message)

Public Methods

public InAppMessage.Builder addAction (String actionName, JsonValue actionValue)

Adds an action to run when the in-app message is displayed.

Parameters
actionName The action name.
actionValue The action value.
Returns
  • The builder.

public InAppMessage build ()

Builds the in-app message.

Returns
  • The built in-app message.
Throws
IllegalArgumentException If the ID is missing, ID length is greater than the MAX_ID_LENGTH, or if the content is missing.

public InAppMessage.Builder setActions (Map<StringJsonValue> actions)

Sets the actions to run when the in-app message is displayed.

Parameters
actions The action map.
Returns
  • The builder.

public InAppMessage.Builder setAudience (Audience audience)

Sets the audience.

Parameters
audience The audience.
Returns
  • The builder.

public InAppMessage.Builder setDisplayContent (CustomDisplayContent displayContent)

Sets the custom display content and type.

Parameters
displayContent The custom display content.
Returns
  • The builder.

public InAppMessage.Builder setDisplayContent (BannerDisplayContent displayContent)

Sets the banner display content and type.

Parameters
displayContent The banner display content.
Returns
  • The builder.

public InAppMessage.Builder setDisplayContent (ModalDisplayContent displayContent)

Sets the modal display content and type.

Parameters
displayContent The modal display content.
Returns
  • The builder.

public InAppMessage.Builder setDisplayContent (FullScreenDisplayContent displayContent)

Sets the full screen display content and type.

Parameters
displayContent The full screen display content.
Returns
  • The builder.

public InAppMessage.Builder setDisplayContent (HtmlDisplayContent displayContent)

Sets the html display content and type.

Parameters
displayContent The html display content.
Returns
  • The builder.

public InAppMessage.Builder setExtras (JsonMap extras)

Sets the extras.

Parameters
extras An extra json map.
Returns
  • The builder.

public InAppMessage.Builder setId (String id)

Sets the in-app message ID.

Parameters
id The message ID.
Returns
  • The builder.