public class

InAppMessageManager

extends Object
java.lang.Object
   ↳ com.urbanairship.iam.InAppMessageManager

Class Overview

In-app messaging manager.

Summary

Nested Classes
interface InAppMessageManager.DisplayDelegate A display delegate that can be used to determine if an In-App message is ready for display or not. 
Constants
long DEFAULT_DISPLAY_INTERVAL_MS Default delay between displaying in-app messages.
Public Methods
void addListener(InAppMessageListener listener)
Adds a listener.
AssetManager getAssetManager()
Gets the asset manager.
long getDisplayInterval()
Gets the display interval in milliseconds.
void notifyDisplayConditionsChanged()
Notifies In-App messages that the display conditions should be reevaluated.
void onMessageScheduleFinished(String scheduleId)
void onNewMessageSchedule(String scheduleId, InAppMessage message)
void removeListener(InAppMessageListener listener)
Removes a listener.
void setAdapterFactory(String displayType, InAppMessageAdapter.Factory factory)
Sets a InAppMessageAdapter for a given display type.
void setDisplayDelegate(InAppMessageManager.DisplayDelegate displayDelegate)
Sets a custom display delegate that can be used to prevent In-App message from displaying.
void setDisplayInterval(long time, TimeUnit timeUnit)
Sets the in-app message display interval on the default display coordinator.
void setMessageExtender(InAppMessageExtender extender)
Sets the message extender.
void setOnRequestDisplayCoordinatorCallback(OnRequestDisplayCoordinatorCallback callback)
Sets the callback for requesting display coordinators.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final long DEFAULT_DISPLAY_INTERVAL_MS

Default delay between displaying in-app messages.

Constant Value: 0 (0x0000000000000000)

Public Methods

public void addListener (InAppMessageListener listener)

Adds a listener.

Parameters
listener The listener.

public AssetManager getAssetManager ()

Gets the asset manager.

Returns
  • The asset manager.

public long getDisplayInterval ()

Gets the display interval in milliseconds.

Returns
  • The display interval in milliseconds.

public void notifyDisplayConditionsChanged ()

Notifies In-App messages that the display conditions should be reevaluated. This should only be called when state from setDisplayDelegate(DisplayDelegate) changes.

public void onMessageScheduleFinished (String scheduleId)

public void onNewMessageSchedule (String scheduleId, InAppMessage message)

public void removeListener (InAppMessageListener listener)

Removes a listener.

Parameters
listener The listener.

public void setAdapterFactory (String displayType, InAppMessageAdapter.Factory factory)

Sets a InAppMessageAdapter for a given display type.

Parameters
displayType The display type.
factory The adapter factory.

public void setDisplayDelegate (InAppMessageManager.DisplayDelegate displayDelegate)

Sets a custom display delegate that can be used to prevent In-App message from displaying.

Parameters
displayDelegate The display delegate.

public void setDisplayInterval (long time, TimeUnit timeUnit)

Sets the in-app message display interval on the default display coordinator. Defaults to DEFAULT_DISPLAY_INTERVAL_MS.

Parameters
time The display interval.
timeUnit The time unit.

public void setMessageExtender (InAppMessageExtender extender)

Sets the message extender. The message will be extended before asset caching, or before the message is prepared for display.

Parameters
extender The extender.

public void setOnRequestDisplayCoordinatorCallback (OnRequestDisplayCoordinatorCallback callback)

Sets the callback for requesting display coordinators.

Parameters
callback The display request callback.