java.lang.Object | ||
↳ | com.urbanairship.BaseManager | |
↳ | com.urbanairship.push.iam.InAppMessageManager |
This class is the primary interface for interacting with in-app messages.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
interface | InAppMessageManager.Listener | Listener for in-app messaging receive and display events. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | EXCLUDE_FROM_AUTO_SHOW | Activity metadata key to exclude an activity from automatically displaying an in-app message. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addListener(InAppMessageManager.Listener listener)
Subscribe a listener for in-app message events.
| ||||||||||
long |
getAutoDisplayDelay()
Gets the delay in milliseconds before an in-app message is automatically displayed when
an activity is resumed.
| ||||||||||
InAppMessageFragmentFactory |
getFragmentFactory()
Returns the current in-app message fragment factory.
| ||||||||||
InAppMessage |
getPendingMessage()
Gets the pending in-app message.
| ||||||||||
boolean |
isAutoDisplayEnabled()
Checks if auto displaying in-app messages is enabled.
| ||||||||||
boolean |
isDisplayAsapEnabled()
Checks in-app messages should be displayed as soon as possible or only on app foregrounds.
| ||||||||||
void |
removeListener(InAppMessageManager.Listener listener)
Unsubscribe a listener for in-app message events.
| ||||||||||
void |
setAutoDisplayDelay(long milliseconds)
Sets the default delay before an in-app message is automatically displayed when an activity
is resumed.
| ||||||||||
void |
setAutoDisplayEnabled(boolean enabled)
Sets if in-app messages should be displayed automatically.
| ||||||||||
void |
setDisplayAsapEnabled(boolean enabled)
Sets if in-app messages should be displayed as soon as possible or only on app foregrounds.
| ||||||||||
void |
setFragmentFactory(InAppMessageFragmentFactory factory)
Sets the the in-app message fragment factory.
| ||||||||||
void |
setPendingMessage(InAppMessage message)
Sets the pending in-app message.
| ||||||||||
boolean |
showPendingMessage(Activity activity, int containerId)
Shows the pending in-app message in a specified container ID.
| ||||||||||
boolean |
showPendingMessage(Activity activity, int containerId, int enterAnimation, int exitAnimation)
Shows the pending in-app message in a specified container ID and fragment animations.
| ||||||||||
boolean |
showPendingMessage(Activity activity)
Shows the pending in-app message.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
init()
Initialize the manager.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Activity metadata key to exclude an activity from automatically displaying an in-app message.
Subscribe a listener for in-app message events.
listener | An object implementing the
InAppMessageManager.Listener interface.
|
---|
Gets the delay in milliseconds before an in-app message is automatically displayed when an activity is resumed.
Returns the current in-app message fragment factory.
Gets the pending in-app message.
Checks if auto displaying in-app messages is enabled.
true
if displaying in-app messages automatically is enabled, otherwise
false
.
Checks in-app messages should be displayed as soon as possible or only on app foregrounds.
true
if in-app messages as soon as possible is enabled, otherwise
false
.
Unsubscribe a listener for in-app message events.
listener | An object implementing the
InAppMessageManager.Listener interface.
|
---|
Sets the default delay before an in-app message is automatically displayed when an activity is resumed.
milliseconds | The auto display delay in milliseconds. |
---|
Sets if in-app messages should be displayed automatically.
enabled | true to display in-app messages automatically, otherwise false .
|
---|
Sets if in-app messages should be displayed as soon as possible or only on app foregrounds.
If a pending in-app message is already available, it will be displayed on the next time an activity is resumed.enabled | true to enable display in-app messages as soon as possible, otherwise
false .
|
---|
Sets the the in-app message fragment factory. The factory can be used to provide a customized in-app message fragment to provide a different look and feel for in-app messages.
factory | The InAppMessageFragmentFactory. |
---|
Sets the pending in-app message.
message | The in-app message. |
---|
Shows the pending in-app message in a specified container ID.
activity | The current activity. |
---|---|
containerId | An ID of a container in the activity's view to add the
InAppMessageFragment . |
true
if a InAppMessageFragment
was added and displayed in the
activity, otherwise false
.
Shows the pending in-app message in a specified container ID and fragment animations.
Note: The animations must refer to API 11 object animators. View animators will result in a runtime exception.activity | The current activity. |
---|---|
containerId | An ID of a container in the activity's view to add the
InAppMessageFragment . |
enterAnimation | The animation resource to run when the InAppMessageFragment
enters the view. |
exitAnimation | The animation resource to run when the InAppMessageFragment
exits the view. |
true
if a InAppMessageFragment
was added and displayed in the
activity, otherwise false
.
Shows the pending in-app message.
activity | The current activity. |
---|
true
if a InAppMessageFragment
was added and displayed in the
activity, otherwise false
.