# Google.Play.AssetDelivery.PlayAssetDelivery

Provides methods for retrieving asset packs via the [Play](https://developer.android.com/reference/unity/namespace/Google/Play#namespaceGoogle_1_1Play) Asset Delivery system.

## Summary

| ### Public static functions ||
|---|---|
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetDelivery#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetDelivery_1a24840935be90aaa61303c72d8170d93d(IList< string > assetPackNames)` | `PlayAsyncOperation< IDictionary< string, https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackDownloadInfo#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackDownloadInfo >, https://developer.android.com/reference/unity/namespace/Google/Play/AssetDelivery#namespaceGoogle_1_1Play_1_1AssetDelivery_1a84566dc4da8247c6613f8bfb2d2c1736 >` Starts a PlayAsyncOperation to gather download information about the specified asset packs. |
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetDelivery#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetDelivery_1a97a648bffbb95c093757f8e6883fd24d(string assetPackName)` | `PlayAsyncOperation< long, https://developer.android.com/reference/unity/namespace/Google/Play/AssetDelivery#namespaceGoogle_1_1Play_1_1AssetDelivery_1a84566dc4da8247c6613f8bfb2d2c1736 >` Starts a PlayAsyncOperation to determine the download size in bytes of the specified asset pack. |
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetDelivery#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetDelivery_1a211caa18332d39c9e8728d40bf0c17ff(string assetPackName)` | `bool` Returns whether or not the specified asset pack is available on disk. |
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetDelivery#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetDelivery_1aaec63fccabd9941b74c3f69a70b2ff69(string assetPackName)` | `PlayAsyncOperation< https://developer.android.com/reference/unity/class/Google/Play/Common/VoidResult#classGoogle_1_1Play_1_1Common_1_1VoidResult, https://developer.android.com/reference/unity/namespace/Google/Play/AssetDelivery#namespaceGoogle_1_1Play_1_1AssetDelivery_1a84566dc4da8247c6613f8bfb2d2c1736 >` Starts a PlayAsyncOperation to delete the specified asset pack from internal storage. |
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetDelivery#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetDelivery_1a48122efc87ae2b05374675ed36b27820(string assetBundleName)` | `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest` Starts a [PlayAssetBundleRequest](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest) to retrieve an asset pack containing only the specified AssetBundle. |
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetDelivery#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetDelivery_1a1e041ad6a9d068341244a9f3c847b64f(string assetBundleName, bool updateIfAvailable)` | `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest` Starts a [PlayAssetBundleRequest](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest) to retrieve an asset pack containing only the specified AssetBundle. |
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetDelivery#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetDelivery_1aa514ff5cc9673910377e5926607a6a8a(string assetPackName)` | `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest` Starts a [PlayAssetPackRequest](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest) to retrieve the specified asset pack. |
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetDelivery#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetDelivery_1afe08c3d309199b1fd75a2b2e13edd1c5(string assetPackName, bool updateIfAvailable)` | `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest` Starts a [PlayAssetPackRequest](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest) to retrieve the specified asset pack. |
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetDelivery#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetDelivery_1a2aa5d8e4be44f69d868666bde4340c55(IList< string > assetPackNames)` | `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackBatchRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackBatchRequest` Starts a [PlayAssetPackBatchRequest](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackBatchRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackBatchRequest) to retrieve the specified asset packs. |
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetDelivery#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetDelivery_1a5a531c3752520a81b572507f5e8ba988(IList< string > assetPackNames, bool updateIfAvailable)` | `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackBatchRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackBatchRequest` Starts a [PlayAssetPackBatchRequest](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackBatchRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackBatchRequest) to retrieve the specified asset packs. |
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetDelivery#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetDelivery_1a645c63f6c09754d963b166f8072dc567()` | `PlayAsyncOperation< https://developer.android.com/reference/unity/namespace/Google/Play/AssetDelivery#namespaceGoogle_1_1Play_1_1AssetDelivery_1a722281133e5bccad65e73139a2e01c49, https://developer.android.com/reference/unity/namespace/Google/Play/AssetDelivery#namespaceGoogle_1_1Play_1_1AssetDelivery_1a84566dc4da8247c6613f8bfb2d2c1736 >` Shows a confirmation dialog for all currently downloading asset packs that are AssetDeliveryStatus.WaitingForWifi. |
| `https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetDelivery#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetDelivery_1a28f9f81bd54661900b1ccb317ddcfb54()` | `PlayAsyncOperation< https://developer.android.com/reference/unity/namespace/Google/Play/AssetDelivery#namespaceGoogle_1_1Play_1_1AssetDelivery_1a722281133e5bccad65e73139a2e01c49, https://developer.android.com/reference/unity/namespace/Google/Play/AssetDelivery#namespaceGoogle_1_1Play_1_1AssetDelivery_1a84566dc4da8247c6613f8bfb2d2c1736 >` Shows a dialog that asks the user for consent to download packs that are currently in either the AssetDeliveryStatus.RequiresUserConfirmation state or the AssetDeliveryStatus.WaitingForWifi state. |

## Public static functions

### GetDownloadInfo

```c#
PlayAsyncOperation< IDictionary< string, PlayAssetPackDownloadInfo >, AssetDeliveryErrorCode > GetDownloadInfo(
  IList< string > assetPackNames
)
```
Starts a PlayAsyncOperation to gather download information about the specified asset packs.

This includes download size and information about asset pack updates.

<br />

Details Parameters `assetPackNames` A list of asset packs. **Returns** A PlayAsyncOperation with a Dictionary result keyed by asset pack name, containing download info about the specified packs.

### GetDownloadSize

```c#
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

```c#
bool IsDownloaded(
  string assetPackName
)
```
Returns whether or not the specified asset pack is available on disk.

<br />

Details Parameters `assetPackName` The name of the desired asset pack. **Returns** True if the asset pack is available on disk and false if not.

### RemoveAssetPack

```c#
PlayAsyncOperation< VoidResult, AssetDeliveryErrorCode > RemoveAssetPack(
  string assetPackName
)
```
Starts a PlayAsyncOperation to delete the specified asset pack from internal storage.

If the specified asset pack is currently being retrieved, this method will not cancel the retrieval. If the specified asset pack contains any AssetBundles that are already loaded into memory, the AssetBundles will **not** be unloaded.

<br />

| Details ||
|---|---|
| **Returns** | An async operation object used to monitor the asset pack removal. 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

```c#
PlayAssetBundleRequest RetrieveAssetBundleAsync(
  string assetBundleName
)
```
Starts a [PlayAssetBundleRequest](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest) to retrieve an asset pack containing only the specified AssetBundle.

Both the AssetBundle and asset pack must share the same name. Downloads the asset pack if it isn't already available on disk.

After download, the contained AssetBundle is loaded into memory before the request completes.

<br />

Details Parameters `assetBundleName` The name of the requested AssetBundle. Exceptions `ArgumentException` Thrown if there is already an active request with the specified name. **Returns** A request object used to monitor the asynchronous AssetBundle retrieval.

### RetrieveAssetBundleAsync

```c#
PlayAssetBundleRequest RetrieveAssetBundleAsync(
  string assetBundleName,
  bool updateIfAvailable
)
```
Starts a [PlayAssetBundleRequest](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest) to retrieve an asset pack containing only the specified AssetBundle.

Both the AssetBundle and asset pack must share the same name. Downloads the asset pack if it isn't already available on disk.

After download, the contained AssetBundle is loaded into memory before the request completes.

<br />

Details Parameters `assetBundleName` The name of the requested AssetBundle. `updateIfAvailable` If true and the specified pack is already installed, this method will check for a newer version and download it if available. Exceptions `ArgumentException` Thrown if there is already an active request with the specified name. **Returns** A request object used to monitor the asynchronous AssetBundle retrieval.

### RetrieveAssetPackAsync

```c#
PlayAssetPackRequest RetrieveAssetPackAsync(
  string assetPackName
)
```
Starts a [PlayAssetPackRequest](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest) to retrieve the specified asset pack.

Downloads the asset pack if it isn't already available on disk.

After download, the assets and/or AssetBundles contained in the asset pack are **not** loaded into memory. To load them see [PlayAssetPackRequest.GetAssetLocation](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest_1abf75a8c64a3a947b578bffeaee66a78b) or [PlayAssetPackRequest.LoadAssetBundleAsync](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest_1a088d0f57a1e8d755f454c8d67290022a).

<br />

Details Parameters `assetPackName` The name of the requested asset pack. **Returns** A request object used to monitor the asynchronous asset pack retrieval.

### RetrieveAssetPackAsync

```c#
PlayAssetPackRequest RetrieveAssetPackAsync(
  string assetPackName,
  bool updateIfAvailable
)
```
Starts a [PlayAssetPackRequest](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest) to retrieve the specified asset pack.

Downloads the asset pack if it isn't already available on disk.

After download, the assets and/or AssetBundles contained in the asset pack are **not** loaded into memory. To load them see [PlayAssetPackRequest.GetAssetLocation](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest_1abf75a8c64a3a947b578bffeaee66a78b) or [PlayAssetPackRequest.LoadAssetBundleAsync](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest_1a088d0f57a1e8d755f454c8d67290022a).

<br />

Details Parameters `assetPackName` The name of the requested asset pack. `updateIfAvailable` If true and the specified pack is already installed, this method will check for a newer version and download it if available. **Returns** A request object used to monitor the asynchronous asset pack retrieval.

### RetrieveAssetPackBatchAsync

```c#
PlayAssetPackBatchRequest RetrieveAssetPackBatchAsync(
  IList< string > assetPackNames
)
```
Starts a [PlayAssetPackBatchRequest](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackBatchRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackBatchRequest) to retrieve the specified asset packs.

Downloads the asset packs if they aren't already available on disk.

After download, the assets and/or AssetBundles contained in the asset pack are **not** loaded into memory. To load them use [PlayAssetPackRequest.GetAssetLocation](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest_1abf75a8c64a3a947b578bffeaee66a78b) or [PlayAssetPackRequest.LoadAssetBundleAsync](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest_1a088d0f57a1e8d755f454c8d67290022a) on the values of the [PlayAssetPackBatchRequest.Requests](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackBatchRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackBatchRequest_1a49da7c2e4ffee675eccaf64aabc9cfd7) dictionary.

<br />

Details Parameters `assetPackNames` A list of requested asset packs. Exceptions `ArgumentException` Throws if assetPackNames contains duplicate entries. **Returns** A request object used to monitor the asynchronous asset pack batch retrieval.

### RetrieveAssetPackBatchAsync

```c#
PlayAssetPackBatchRequest RetrieveAssetPackBatchAsync(
  IList< string > assetPackNames,
  bool updateIfAvailable
)
```
Starts a [PlayAssetPackBatchRequest](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackBatchRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackBatchRequest) to retrieve the specified asset packs.

Downloads the asset packs if they aren't already available on disk.

After download, the assets and/or AssetBundles contained in the asset pack are **not** loaded into memory. To load them use [PlayAssetPackRequest.GetAssetLocation](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest_1abf75a8c64a3a947b578bffeaee66a78b) or [PlayAssetPackRequest.LoadAssetBundleAsync](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackRequest_1a088d0f57a1e8d755f454c8d67290022a) on the values of the [PlayAssetPackBatchRequest.Requests](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetPackBatchRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetPackBatchRequest_1a49da7c2e4ffee675eccaf64aabc9cfd7) dictionary.

<br />

Details Parameters `assetPackNames` A list of requested asset packs. `updateIfAvailable` If true and any of the specified packs are already installed, this method will check for newer versions of them and download them if available. Exceptions `ArgumentException` Throws if assetPackNames contains duplicate entries. **Returns** A request object used to monitor the asynchronous asset pack batch retrieval.

### ShowCellularDataConfirmation

```c#
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](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest) is set to AssetDeliveryStatus.WaitingForWifi if the user is currently not on a Wi-Fi connection and the AssetBundle is large or the user has set their download preference in the [Play](https://developer.android.com/reference/unity/namespace/Google/Play#namespaceGoogle_1_1Play) Store to only download apps over Wi-Fi. By showing this dialog, the app can ask the user if they accept downloading the asset packs over cellular data instead of waiting for Wi-Fi.

<br />

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

### ShowConfirmationDialog

```c#
PlayAsyncOperation< ConfirmationDialogResult, AssetDeliveryErrorCode > ShowConfirmationDialog()
```
Shows a dialog that asks the user for consent to download packs that are currently in either the AssetDeliveryStatus.RequiresUserConfirmation state or the AssetDeliveryStatus.WaitingForWifi state.

A [PlayAssetBundleRequest](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest) is set to AssetDeliveryStatus.RequiresUserConfirmation If the download is not able to proceed without user consent. By showing this dialog, the app can ask the user if they accept downloading the asset packs through [Google](https://developer.android.com/reference/unity/namespace/Google#namespaceGoogle)[Play](https://developer.android.com/reference/unity/namespace/Google/Play#namespaceGoogle_1_1Play). If the app has not been installed by [Play](https://developer.android.com/reference/unity/namespace/Google/Play#namespaceGoogle_1_1Play), an update may be triggered to ensure that a valid version is installed. This will cause the app to restart and all asset requests to be cancelled. These assets should be requested again after the app restarts.

A [PlayAssetBundleRequest](https://developer.android.com/reference/unity/class/Google/Play/AssetDelivery/PlayAssetBundleRequest#classGoogle_1_1Play_1_1AssetDelivery_1_1PlayAssetBundleRequest) is set to AssetDeliveryStatus.WaitingForWifi if the user is currently not on a Wi-Fi connection and the AssetBundle is large or the user has set their download preference in the [Play](https://developer.android.com/reference/unity/namespace/Google/Play#namespaceGoogle_1_1Play) Store to only download apps over Wi-Fi. By showing this dialog, the app can ask the user if they accept downloading the asset packs over cellular data instead of waiting for Wi-Fi.

<br />

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