Version: stable
pad.cancel(pack_name)
Requests to cancel the download of the specified asset packs.
PARAMETERS
pack_name |
string |
pad.fetch(pack_name)
Requests to download the specified asset pack.
PARAMETERS
pack_name |
string |
pad.remove_pack(pack_name)
Deletes the specified asset pack from the internal storage of the app.
PARAMETERS
pack_name |
string |
pad.get_pack_state(pack_name)
Requests download state and details for the specified asset pack. This is an asynchronous function and will send a `PACK_STATE_UPDATED` event once the new state is available.
PARAMETERS
pack_name |
string |
pad.get_pack_location(pack_name)
Returns the location of the specified asset pack on the device or an empty string if this pack is not downloaded.
PARAMETERS
pack_name |
string |
RETURNS
strin |
pad.get_pack_bytes_downloaded(pack_name)
Returns the total number of bytes already downloaded for the pack. Note that you must have called the `get_pack_state()` function first and wait for a `PACK_STATE_UPDATED` event before calling this function.
PARAMETERS
pack_name |
string |
RETURNS
bytes_downloade |
pad.get_pack_error_code(pack_name)
Returns the error code for the pack, if Play has failed to download the pack. Note that you must have called the `get_pack_state()` function first and wait for a `PACK_STATE_UPDATED` event before calling this function.
PARAMETERS
pack_name |
string |
RETURNS
error_cod |
pad.get_pack_status(pack_name)
Returns the download status of the pack. Note that you must have called the `get_pack_state()` function first and wait for a `PACK_STATE_UPDATED` event before calling this function.
PARAMETERS
pack_name |
string |
RETURNS
statu |
pad.get_pack_total_bytes_to_download(pack_name)
Returns the total size of the pack in bytes. Note that you must have called the `get_pack_state()` function first and wait for a `PACK_STATE_UPDATED` event before calling this function.
PARAMETERS
pack_name |
string |
RETURNS
bytes_to_downloa |
pad.get_pack_transfer_progress_percentage(pack_name)
Returns the percentage of the asset pack already transferred to the app. Note that you must have called the `get_pack_state()` function first and wait for a `PACK_STATE_UPDATED` event before calling this function.
PARAMETERS
pack_name |
string |
RETURNS
numbe |
pad.show_confirmation_dialog(pack_name)
Shows a dialog that asks the user for consent to download packs Shows a dialog that asks the user for consent to download packs that are currently in either the AssetPackStatus.REQUIRES_USER_CONFIRMATION state or the AssetPackStatus.WAITING_FOR_WIFI state. Will return result in event listener.
PARAMETERS
pack_name |
string |
pad.set_listener(listener)
Set listener to receive events
PARAMETERS
listener |
function |
The function to call (self, event) |
Returned if AssetPackManager.showConfirmationDialog(Activity) is called but no asset packs require user confirmation.
Returned if AssetPackManager.showCellularDataConfirmation(Activity) is called but no asset packs are waiting for Wi-Fi.
The Play Store app is either not installed or not the official version.