public interface IInAppMessage extends IPutIntoJson<org.json.JSONObject>
It implicitly defines policy for in-app message fields that can be changed from outside the object.
Modifier and Type | Method and Description |
---|---|
boolean |
getAnimateIn()
Gets whether this in-app message will animate in or
appear suddenly.
|
boolean |
getAnimateOut()
Gets whether this in-app message will animate out or
disappear suddenly.
|
int |
getBackgroundColor()
Gets the background color on this in-app message.
|
ClickAction |
getClickAction()
Gets the click action of this in-app message.
|
CropType |
getCropType()
Gets the crop type for this in-app message's image.
|
DismissType |
getDismissType()
Gets the dismiss type of this in-app message.
|
int |
getDurationInMilliseconds()
Gets the duration of this in-app message.
|
long |
getExpirationTimestamp()
Get the UTC timestamp at which this message expires and will not be displayed.
|
java.util.Map<java.lang.String,java.lang.String> |
getExtras()
Gets the extras on this in-app message as a map
of key value pairs.
|
java.lang.String |
getIcon()
Gets the Font Awesome icon on this in-app message.
|
int |
getIconBackgroundColor()
Gets the icon background color on this in-app message.
|
int |
getIconColor()
Gets the icon color on this in-app message.
|
java.util.Map<java.lang.String,java.lang.String> |
getLocalPrefetchedAssetPaths()
Gets where to find the pre-fetched remote assets
specified in
setLocalPrefetchedAssetPaths(Map) . |
java.lang.String |
getMessage()
Gets the message text on this in-app message.
|
TextAlign |
getMessageTextAlign()
Get the text alignment for the message text.
|
int |
getMessageTextColor()
Gets the message text color on this in-app message.
|
MessageType |
getMessageType()
The
MessageType of this in-app message. |
boolean |
getOpenUriInWebView()
Whether to use AppboyWebViewActivity to open deep links from this in-app message.
|
Orientation |
getOrientation()
Gets the preferred screen orientation for this in-app message.
|
java.util.List<java.lang.String> |
getRemoteAssetPathsForPrefetch()
Returns a path to remote assets that can be pre-fetched.
|
android.net.Uri |
getUri()
Gets the URI on this in-app message.
|
boolean |
isControl()
Gets whether this in-app message is a control for multivariate testing.
|
boolean |
logClick()
Logs a click on this in-app message.
|
boolean |
logDisplayFailure(InAppMessageFailureType failureType)
Logs a display failure on this in-app message.
|
boolean |
logImpression()
Logs an impression on this in-app message.
|
void |
onAfterClosed()
Should be called on the in-app message once it is no longer being displayed, to allow it
to perform any cleanup or trigger further actions.
|
void |
setAnimateIn(boolean animateIn)
Sets whether this in-app message will animate in or
appear suddenly.
|
void |
setAnimateOut(boolean animateOut)
Sets whether this in-app message will animate out or
disappear suddenly.
|
void |
setBackgroundColor(int backgroundColor)
Sets the background color on this in-app message.
|
boolean |
setClickAction(ClickAction clickAction)
Sets the click action of this in-app message.
|
boolean |
setClickAction(ClickAction clickAction,
android.net.Uri uri)
Sets the click action of this in-app message.
|
void |
setCropType(CropType cropType)
Sets the crop type for this in-app message's image.
|
void |
setDismissType(DismissType dismissType)
Sets the dismiss type of this in-app message.
|
void |
setDurationInMilliseconds(int durationInMilliseconds)
Sets the duration of this in-app message.
|
void |
setExpirationTimestamp(long expirationTimestamp)
Set the UTC timestamp at which this message expires and will not be displayed.
|
void |
setExtras(java.util.Map<java.lang.String,java.lang.String> extras)
Sets or overrides the extras on this in-app message as a map
of key value pairs.
|
void |
setIcon(java.lang.String icon)
Sets the icon on this in-app message.
|
void |
setIconBackgroundColor(int iconColor)
Sets the icon background color on this in-app message.
|
void |
setIconColor(int iconColor)
Sets the icon color on this in-app message.
|
void |
setLocalPrefetchedAssetPaths(java.util.Map<java.lang.String,java.lang.String> remotePathToLocalAssetMap)
Instruct this in-app message where to find pre-fetched
assets for remote assets specified in
getRemoteAssetPathsForPrefetch() . |
void |
setMessage(java.lang.String message)
Sets the message text of this in-app message.
|
void |
setMessageTextAlign(TextAlign textAlign)
Set the text alignment for the message text.
|
void |
setMessageTextColor(int textColor)
Sets the message text color on this in-app message.
|
void |
setOpenUriInWebView(boolean openUriInWebView)
Sets whether to use AppboyWebViewActivity to open deep links from this in-app message.
|
void |
setOrientation(Orientation orientation)
Sets the preferred screen orientation for this in-app message.
|
forJsonPut
java.lang.String getMessage()
java.util.Map<java.lang.String,java.lang.String> getExtras()
void setExtras(java.util.Map<java.lang.String,java.lang.String> extras)
extras
- A map of extras on this in-app message.int getDurationInMilliseconds()
int getBackgroundColor()
Color
int getIconColor()
See getIconColor()
Color
int getIconBackgroundColor()
Color
int getMessageTextColor()
Color
java.lang.String getIcon()
boolean getAnimateIn()
boolean getAnimateOut()
ClickAction getClickAction()
See ClickAction
android.net.Uri getUri()
DismissType getDismissType()
See DismissType
java.util.List<java.lang.String> getRemoteAssetPathsForPrefetch()
setLocalPrefetchedAssetPaths(Map)
Orientation getOrientation()
In-app messages will only display if the preferred orientation matches the current activity orientation. However, there is an important exception for tablets For in-app messages that have a preferred orientation and are being displayed on tablet, the in-app message will appear in the style of the preferred orientation regardless of actual screen orientation.
CropType getCropType()
TextAlign getMessageTextAlign()
long getExpirationTimestamp()
boolean getOpenUriInWebView()
When true, the SDK will make a best effort to use AppboyWebViewActivity to open the deep link.
When false, deep links are opened using an Intent.ACTION_VIEW intent.
MessageType getMessageType()
MessageType
of this in-app message.void setOpenUriInWebView(boolean openUriInWebView)
openUriInWebView
- whether AppboyWebViewActivity should be used to open deep links from this
in-app message.void setExpirationTimestamp(long expirationTimestamp)
expirationTimestamp
- expiration timestamp for the messagevoid setMessageTextAlign(TextAlign textAlign)
textAlign
- the text alignment for the message textvoid setCropType(CropType cropType)
cropType
- the image crop type for this in-app message's image.void setOrientation(Orientation orientation)
In-app messages will only display if the preferred orientation matches the current activity orientation. However, there is an important exception for tablets For in-app messages that have a preferred orientation and are being displayed on tablet, the in-app message will appear in the style of the preferred orientation regardless of actual screen orientation.
orientation
- the preferred screen orientation for this in-app messagevoid setMessage(java.lang.String message)
message
- the desired message text for this in-app message.void setAnimateIn(boolean animateIn)
animateIn
- whether to animate the in-app message in.void setAnimateOut(boolean animateOut)
animateOut
- whether to animate the in-app message out.boolean setClickAction(ClickAction clickAction)
See ClickAction
clickAction
- The desired click action.boolean setClickAction(ClickAction clickAction, android.net.Uri uri)
See ClickAction
clickAction
- The desired click action.uri
- A valid Uri to navigate to on click. To set the Uri,
the click action must be set to URI and a non-null Uri
must be specified.void setDismissType(DismissType dismissType)
See DismissType
dismissType
- Desired dismiss type.void setDurationInMilliseconds(int durationInMilliseconds)
durationInMilliseconds
- Desired in-app message duration. Inappropriately low or
high values should be set to a reasonable default.void setBackgroundColor(int backgroundColor)
backgroundColor
- See Color
void setIconBackgroundColor(int iconColor)
iconColor
- See Color
void setIconColor(int iconColor)
iconColor
- See Color
void setMessageTextColor(int textColor)
textColor
- See Color
void setIcon(java.lang.String icon)
icon
- Unicode string for the desired Font Awesome icon.void setLocalPrefetchedAssetPaths(java.util.Map<java.lang.String,java.lang.String> remotePathToLocalAssetMap)
getRemoteAssetPathsForPrefetch()
.remotePathToLocalAssetMap
- A map of remote assets Uris to local asset Uri paths.java.util.Map<java.lang.String,java.lang.String> getLocalPrefetchedAssetPaths()
setLocalPrefetchedAssetPaths(Map)
.Map
of remote assets Uris to local asset Uri paths.boolean logImpression()
See logClick()
boolean logClick()
See logImpression()
boolean logDisplayFailure(InAppMessageFailureType failureType)
In-app message display failures may affect campaign statistics so care should be taken when logging display failures.
failureType
- The precise type of the display failure.void onAfterClosed()
boolean isControl()