public class

AirshipPrepareAssetsDelegate

extends Object
implements PrepareAssetsDelegate
java.lang.Object
   ↳ com.urbanairship.iam.assets.AirshipPrepareAssetsDelegate

Class Overview

Default PrepareAssetsDelegate for Airship message types.

Summary

Constants
String IMAGE_HEIGHT_CACHE_KEY Cache key for the image height.
String IMAGE_WIDTH_CACHE_KEY Cache key for the image width.
Public Constructors
AirshipPrepareAssetsDelegate()
Public Methods
static String getCacheableUrl(MediaInfo mediaInfo)
int onPrepare(String scheduleId, InAppMessage message, Assets assets)
Called to prepare assets for the in-app message before the message is displayed.
void onSchedule(String scheduleId, InAppMessage message, Assets assets)
Called to prepare assets for the in-app message when the message is scheduled.
Protected Methods
FileUtils.DownloadResult cacheImage(Assets assets, String url)
Helper method that caches an image in the assets.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.urbanairship.iam.assets.PrepareAssetsDelegate

Constants

public static final String IMAGE_HEIGHT_CACHE_KEY

Cache key for the image height.

Constant Value: "height"

public static final String IMAGE_WIDTH_CACHE_KEY

Cache key for the image width.

Constant Value: "width"

Public Constructors

public AirshipPrepareAssetsDelegate ()

Public Methods

public static String getCacheableUrl (MediaInfo mediaInfo)

public int onPrepare (String scheduleId, InAppMessage message, Assets assets)

Called to prepare assets for the in-app message before the message is displayed.

Parameters
scheduleId The scheduleId.
message The message. This might be different then schedule's message if the message was extended.
assets The assets.
Returns
  • The prepare result.

public void onSchedule (String scheduleId, InAppMessage message, Assets assets)

Called to prepare assets for the in-app message when the message is scheduled. If any assets fail to download, onPrepare(String, InAppMessage, Assets) will still be called before the message is displayed.

Parameters
scheduleId The scheduleId.
message The message. This might be different then schedule's message if the message was extended.
assets The assets.

Protected Methods

protected FileUtils.DownloadResult cacheImage (Assets assets, String url)

Helper method that caches an image in the assets.

Parameters
assets The assets.
url The image URL.
Returns
  • The download result.
Throws
IOException If the URL is invalid.