public class

DisplayHandler

extends Object
implements Parcelable
java.lang.Object
   ↳ com.urbanairship.iam.DisplayHandler

Class Overview

Display handler for in-app message displays.

In-app message should call isDisplayAllowed(Context) before displaying the in-app message if the in-app message is displayed in its own activity. Typically, this should be done in an Activity's or Fragment's onCreate callbacks.

When the in-app message is finished, call finished(ResolutionInfo, long). This will finish the display of an in-app message and allow it to be triggered again by one of the in-app message triggers.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Public Methods
void cancelFutureDisplays()
Prevents the message from displaying again.
int describeContents()
void finished(ResolutionInfo resolutionInfo, long displayMilliseconds)
Called when the in-app message is finished displaying.
String getScheduleId()
Gets the schedule ID.
boolean isDisplayAllowed(Context context)
Called to verify display is still allowed.
void writeToParcel(Parcel dest, int flags)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Public Methods

public void cancelFutureDisplays ()

Prevents the message from displaying again.

public int describeContents ()

public void finished (ResolutionInfo resolutionInfo, long displayMilliseconds)

Called when the in-app message is finished displaying. After calling this method, the in-app message should immediately dismiss its view to prevent the current activity from redisplaying the in-app message if still on the back stack.

Parameters
resolutionInfo Info on why the message has finished.
displayMilliseconds The display time in milliseconds

public String getScheduleId ()

Gets the schedule ID.

Returns
  • The schedule ID.

public boolean isDisplayAllowed (Context context)

Called to verify display is still allowed. If the in-app message is being displayed in a fragment or directly in an activity, it should be called in the onStart method. If the in-app message is attached directly to a view it should be called in the view's onWindowVisibilityChanged when the window becomes visible.

Returns
  • true if the message should continue displaying, otherwise false.

public void writeToParcel (Parcel dest, int flags)