public abstract class InAppMessageBase extends java.lang.Object implements IInAppMessage, IInAppMessageThemeable
| Modifier and Type | Field and Description | 
|---|---|
| protected static java.lang.String | ANIMATE_IN | 
| protected static java.lang.String | ANIMATE_OUT | 
| protected static java.lang.String | CROP_TYPE | 
| static int | INAPP_MESSAGE_DURATION_DEFAULT_MILLIS | 
| static int | INAPP_MESSAGE_DURATION_MIN_MILLIS | 
| static java.lang.String | IS_CONTROL | 
| protected IBrazeManager | mBrazeManager | 
| protected CropType | mCropType | 
| protected static java.lang.String | MESSAGE_TEXT_ALIGN | 
| protected InAppMessageTheme | mInAppMessageDarkThemeWrapper | 
| protected org.json.JSONObject | mJsonObject | 
| protected TextAlign | mMessageTextAlign | 
| protected boolean | mOpenUriInWebview | 
| protected static java.lang.String | OPEN_URI_IN_WEBVIEW | 
| static java.lang.String | TYPE | 
| Modifier | Constructor and Description | 
|---|---|
| protected  | InAppMessageBase() | 
|   | InAppMessageBase(org.json.JSONObject object,
                IBrazeManager brazeManager) | 
| Modifier and Type | Method and Description | 
|---|---|
| void | enableDarkTheme()Instructs the  IInAppMessageto apply any dark theme settings
 and override any existing values present on theIInAppMessage. | 
| org.json.JSONObject | forJsonPut()Storing in-app messages serialized with this method is primarily
 for storage as triggered actions. | 
| 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()Note that this class does not have an implementation for this method. | 
| 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. | 
| 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 timestamp)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 iconBackgroundColor)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)The base In-App Message class does not have
 assets of its own. | 
| 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. | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetMessageTypepublic static final int INAPP_MESSAGE_DURATION_DEFAULT_MILLIS
public static final int INAPP_MESSAGE_DURATION_MIN_MILLIS
protected static final java.lang.String CROP_TYPE
protected static final java.lang.String MESSAGE_TEXT_ALIGN
protected static final java.lang.String ANIMATE_IN
protected static final java.lang.String ANIMATE_OUT
protected static final java.lang.String OPEN_URI_IN_WEBVIEW
public static final java.lang.String IS_CONTROL
public static final java.lang.String TYPE
protected CropType mCropType
protected TextAlign mMessageTextAlign
protected boolean mOpenUriInWebview
protected org.json.JSONObject mJsonObject
protected IBrazeManager mBrazeManager
protected InAppMessageTheme mInAppMessageDarkThemeWrapper
protected InAppMessageBase()
public InAppMessageBase(org.json.JSONObject object,
                        IBrazeManager brazeManager)
                 throws org.json.JSONException
org.json.JSONException - if JSON is malformed. Constructed InAppMessageBase
 objects are meant to be fully verified and good to go.public java.lang.String getMessage()
IInAppMessagegetMessage in interface IInAppMessagepublic java.util.Map<java.lang.String,java.lang.String> getExtras()
IInAppMessagegetExtras in interface IInAppMessagepublic void setExtras(java.util.Map<java.lang.String,java.lang.String> extras)
IInAppMessagesetExtras in interface IInAppMessageextras - A map of extras on this in-app message.public int getDurationInMilliseconds()
IInAppMessagegetDurationInMilliseconds in interface IInAppMessagepublic int getBackgroundColor()
IInAppMessagegetBackgroundColor in interface IInAppMessageColorpublic int getIconColor()
IInAppMessagegetIconColor in interface IInAppMessageColorpublic int getIconBackgroundColor()
IInAppMessagegetIconBackgroundColor in interface IInAppMessageColorpublic int getMessageTextColor()
IInAppMessagegetMessageTextColor in interface IInAppMessageColorpublic java.lang.String getIcon()
IInAppMessagegetIcon in interface IInAppMessagepublic boolean getAnimateIn()
IInAppMessagegetAnimateIn in interface IInAppMessagepublic boolean getAnimateOut()
IInAppMessagegetAnimateOut in interface IInAppMessagepublic ClickAction getClickAction()
IInAppMessage
 See ClickAction
getClickAction in interface IInAppMessagepublic android.net.Uri getUri()
IInAppMessage
 See IInAppMessage.setClickAction(ClickAction, android.net.Uri)
getUri in interface IInAppMessagepublic DismissType getDismissType()
IInAppMessage
 See DismissType
getDismissType in interface IInAppMessagepublic Orientation getOrientation()
IInAppMessageIn-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.
getOrientation in interface IInAppMessagepublic CropType getCropType()
IInAppMessagegetCropType in interface IInAppMessagepublic TextAlign getMessageTextAlign()
IInAppMessagegetMessageTextAlign in interface IInAppMessagepublic long getExpirationTimestamp()
IInAppMessagegetExpirationTimestamp in interface IInAppMessagepublic boolean getOpenUriInWebView()
IInAppMessageWhen 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.
getOpenUriInWebView in interface IInAppMessagepublic void setOpenUriInWebView(boolean openUriInWebView)
IInAppMessagesetOpenUriInWebView in interface IInAppMessageopenUriInWebView - whether AppboyWebViewActivity should be used to open deep links from this
                         in-app message.public void setExpirationTimestamp(long timestamp)
IInAppMessagesetExpirationTimestamp in interface IInAppMessagetimestamp - expiration timestamp for the messagepublic void setMessageTextAlign(TextAlign textAlign)
IInAppMessagesetMessageTextAlign in interface IInAppMessagetextAlign - the text alignment for the message textpublic void setCropType(CropType cropType)
IInAppMessagesetCropType in interface IInAppMessagecropType - the image crop type for this in-app message's image.public void setOrientation(Orientation orientation)
IInAppMessageIn-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.
setOrientation in interface IInAppMessageorientation - the preferred screen orientation for this in-app messagepublic void setMessage(java.lang.String message)
IInAppMessagesetMessage in interface IInAppMessagemessage - the desired message text for this in-app message.public void setAnimateIn(boolean animateIn)
IInAppMessagesetAnimateIn in interface IInAppMessageanimateIn - whether to animate the in-app message in.public void setAnimateOut(boolean animateOut)
IInAppMessagesetAnimateOut in interface IInAppMessageanimateOut - whether to animate the in-app message out.public boolean setClickAction(ClickAction clickAction)
IInAppMessage
 See ClickAction
setClickAction in interface IInAppMessageclickAction - The desired click action.public boolean setClickAction(ClickAction clickAction, android.net.Uri uri)
IInAppMessage
 See ClickAction
setClickAction in interface IInAppMessageclickAction - 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.public void setDismissType(DismissType dismissType)
IInAppMessage
 See DismissType
setDismissType in interface IInAppMessagedismissType - Desired dismiss type.public void setDurationInMilliseconds(int durationInMilliseconds)
IInAppMessagesetDurationInMilliseconds in interface IInAppMessagedurationInMilliseconds - Desired in-app message duration. Inappropriately low or
                               high values should be set to a reasonable default.public void setBackgroundColor(int backgroundColor)
IInAppMessagesetBackgroundColor in interface IInAppMessagebackgroundColor - See Colorpublic void setIconColor(int iconColor)
IInAppMessagesetIconColor in interface IInAppMessageiconColor - See Colorpublic void setIconBackgroundColor(int iconBackgroundColor)
IInAppMessagesetIconBackgroundColor in interface IInAppMessageiconBackgroundColor - See Colorpublic void setMessageTextColor(int textColor)
IInAppMessagesetMessageTextColor in interface IInAppMessagetextColor - See Colorpublic void setIcon(java.lang.String icon)
IInAppMessagesetIcon in interface IInAppMessageicon - Unicode string for the desired Font Awesome icon.public java.util.Map<java.lang.String,java.lang.String> getLocalPrefetchedAssetPaths()
getLocalPrefetchedAssetPaths in interface IInAppMessagepublic boolean logImpression()
IInAppMessagelogImpression in interface IInAppMessagepublic boolean logClick()
IInAppMessagelogClick in interface IInAppMessagepublic void onAfterClosed()
IInAppMessageonAfterClosed in interface IInAppMessagepublic boolean isControl()
IInAppMessageisControl in interface IInAppMessagepublic boolean logDisplayFailure(InAppMessageFailureType failureType)
IInAppMessageIn-app message display failures may affect campaign statistics so care should be taken when logging display failures.
logDisplayFailure in interface IInAppMessagefailureType - The precise type of the display failure.public void enableDarkTheme()
IInAppMessageThemeableIInAppMessage to apply any dark theme settings
 and override any existing values present on the IInAppMessage.enableDarkTheme in interface IInAppMessageThemeablepublic java.util.List<java.lang.String> getRemoteAssetPathsForPrefetch()
IInAppMessageIInAppMessage.setLocalPrefetchedAssetPaths(Map)getRemoteAssetPathsForPrefetch in interface IInAppMessagepublic void setLocalPrefetchedAssetPaths(java.util.Map<java.lang.String,java.lang.String> remotePathToLocalAssetMap)
setLocalPrefetchedAssetPaths in interface IInAppMessageremotePathToLocalAssetMap - A map of remote assets Uris to local asset Uri paths.public org.json.JSONObject forJsonPut()
forJsonPut in interface IPutIntoJson<org.json.JSONObject>