Google.Play.AssetDelivery.PlayAssetDelivery

Provides methods for retrieving asset packs via the Play Asset Delivery system.

Summary

Manages in-progress PlayAssetBundleRequests.

Public static functions

GetDownloadSize(string assetPackName)
PlayAsyncOperation< long, AssetDeliveryErrorCode >
Starts a PlayAsyncOperation to determine the download size in bytes of the specified asset pack.
IsDownloaded(string assetPackName)
bool
Returns whether or not the the latest version of an asset pack is available on disk.
RemoveAssetPack(string assetBundleName)
PlayAsyncOperation< VoidResult, AssetDeliveryErrorCode >
Starts a PlayAsyncOperation to delete the specified asset pack from internal storage.
RetrieveAssetBundleAsync(string assetBundleName)
Starts a PlayAssetBundleRequest to retrieve an asset pack containing an AssetBundle.
ShowCellularDataConfirmation()
Shows a confirmation dialog for all currently downloading asset packs that are AssetDeliveryStatus.WaitingForWifi.

Public static functions

GetDownloadSize

PlayAsyncOperation< long, AssetDeliveryErrorCode > GetDownloadSize(
  string assetPackName
)

Starts a PlayAsyncOperation to determine the download size in bytes of the specified asset pack.

If the specified asset pack's delivery mode is install-time, then the download size will always be 0.

IsDownloaded

bool IsDownloaded(
  string assetPackName
)

Returns whether or not the the latest version of an asset pack is available on disk.

Details
Parameters
assetPackName
The name of the desired asset pack.

RemoveAssetPack

PlayAsyncOperation< VoidResult, AssetDeliveryErrorCode > RemoveAssetPack(
  string assetBundleName
)

Starts a PlayAsyncOperation to delete the specified asset pack from internal storage.

If the specified asset pack is currently being retrieved or transferring, this method will not cancel the process. If the specified asset pack contains an AssetBundle that is already loaded into memory, it will not be unloaded.

Details
Returns
If the files are deleted successfully, or if the files don't exist, the returned operation will complete successfully. Otherwise, the operation will complete with an error code.

RetrieveAssetBundleAsync

PlayAssetBundleRequest RetrieveAssetBundleAsync(
  string assetBundleName
)

Starts a PlayAssetBundleRequest to retrieve an asset pack containing an AssetBundle.

Downloads the asset pack if the latest version isn't already available on disk. After download, the contained AssetBundle is loaded into memory.

Details
Parameters
assetBundleName
The name of the requested AssetBundle.
Returns
A request object used to monitor the asynchronous AssetBundle retrieval.

ShowCellularDataConfirmation

PlayAsyncOperation< ConfirmationDialogResult, AssetDeliveryErrorCode > ShowCellularDataConfirmation()

Shows a confirmation dialog for all currently downloading asset packs that are AssetDeliveryStatus.WaitingForWifi.

If the user accepts the dialog, then those Asset packs are downloaded over cellular data.

A PlayAssetBundleRequest is set to AssetDeliveryStatus.WaitingForWifi if the user is currently not on a wifi connection and the AssetBundle is large or the user has set their download preference in the Play Store to only download apps over wifi. By showing this dialog, the app can ask the user if they accept downloading the asset packs over cellular data instead of waiting for wifi.

Details
Returns
A PlayAsyncOperation{ConfirmationDialogResult, AssetDeliveryErrorCode} that completes once the dialog has been accepted, denied, or closed.