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 setDisplayBehavior(String displayBehavior)
Sets the display behavior.
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 setName(String name)
Sets the in-app message name.
InAppMessage.Builder setReportingEnabled(boolean isReportingEnabled)
Enables/disables generating display and resolution events for the in-app message.
[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 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 setDisplayBehavior (String displayBehavior)

Sets the display behavior.

Parameters
displayBehavior The display behavior.
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 setName (String name)

Sets the in-app message name.

Parameters
name The message name.
Returns
  • The builder.

public InAppMessage.Builder setReportingEnabled (boolean isReportingEnabled)

Enables/disables generating display and resolution events for the in-app message.

Parameters
isReportingEnabled true to generate reporting events, otherwise false.
Returns
  • The builder.