public interface

InAppMessageAdapter

com.urbanairship.iam.InAppMessageAdapter
Known Indirect Subclasses

Class Overview

In-app message adapter. An adapter is responsible for displaying a particular type of in-app message.

Summary

Nested Classes
interface InAppMessageAdapter.Factory Factory interface for InAppMessageAdapters. 
@interface InAppMessageAdapter.PrepareResult  
Constants
int CANCEL Indicates that the prepare step failed and the schedule should be canceled.
int OK Indicates a successful result.
int RETRY Indicates that the the prepare step should be retried.
Public Methods
abstract boolean isReady(Context context)
Called before displaying but after the message is prepared.
abstract void onDisplay(Context context, DisplayHandler displayHandler)
Called to display an in-app message.
abstract void onFinish(Context context)
Called after the in-app message is finished displaying.
abstract int onPrepare(Context context, Assets assets)
Called to prepare the message to be displayed.

Constants

public static final int CANCEL

Indicates that the prepare step failed and the schedule should be canceled.

Constant Value: 2 (0x00000002)

public static final int OK

Indicates a successful result.

Constant Value: 0 (0x00000000)

public static final int RETRY

Indicates that the the prepare step should be retried.

Constant Value: 1 (0x00000001)

Public Methods

public abstract boolean isReady (Context context)

Called before displaying but after the message is prepared.

Parameters
context The application context.
Returns
  • true if the message is ready to be displayed, otherwise false.

public abstract void onDisplay (Context context, DisplayHandler displayHandler)

Called to display an in-app message.

Parameters
context The application context.
displayHandler The display handler.

public abstract void onFinish (Context context)

Called after the in-app message is finished displaying. Perform any cache clean up here.

Parameters
context The application context.

public abstract int onPrepare (Context context, Assets assets)

Called to prepare the message to be displayed.

Parameters
context The application context.
assets Any assets that were prepared for the message.
Returns
  • OK if the in-app message is ready to be displayed, RETRY if the message was unable to be prepared and needs to be retried, or CANCEL if the message was unable to be prepared and should be canceled.