Namespace: pad
Language: Lua
Type: Extension
Functionality to work with Play Asset Delivery and the AssetPackManager
Type: FUNCTION Requests to cancel the download of the specified asset packs.
Parameters
pack_name (string)Type: FUNCTION Requests to download the specified asset pack.
Parameters
pack_name (string)Type: FUNCTION Deletes the specified asset pack from the internal storage of the app.
Parameters
pack_name (string)Type: FUNCTION
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)Type: FUNCTION 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
strinType: FUNCTION
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_downloadeType: FUNCTION
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_codType: FUNCTION
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
statuType: FUNCTION
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_downloaType: FUNCTION
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
numbeType: FUNCTION 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)Type: FUNCTION Set listener to receive events
Parameters
listener (function) - The function to call (self, event)Type: VARIABLE
Type: VARIABLE
Type: VARIABLE
Type: VARIABLE
Type: VARIABLE
Type: VARIABLE
Type: VARIABLE
Type: VARIABLE
Type: VARIABLE
Type: VARIABLE
Type: VARIABLE
Type: VARIABLE
Type: VARIABLE
Type: VARIABLE
Type: VARIABLE
Type: VARIABLE
Type: VARIABLE
Type: VARIABLE
Type: VARIABLE
Type: VARIABLE Download not permitted under the current device circumstances
Type: VARIABLE The Asset Delivery API isn’t available.
Type: VARIABLE The app isn’t owned by any user on this device.
Type: VARIABLE The requesting app is unavailable.
Type: VARIABLE Returned if AssetPackManager.showConfirmationDialog(Activity) is called but no asset packs require user confirmation.
Type: VARIABLE The requested download isn’t found.
Type: VARIABLE Asset pack download failed due to insufficient storage.
Type: VARIABLE Unknown error downloading an asset pack.
Type: VARIABLE The request is invalid.
Type: VARIABLE Network error.
Type: VARIABLE Returned if AssetPackManager.showCellularDataConfirmation(Activity) is called but no asset packs are waiting for Wi-Fi.
Type: VARIABLE
Type: VARIABLE The requested asset pack isn’t available.
Type: VARIABLE The Play Store app is either not installed or not the official version.
Type: VARIABLE The installed app version is not recognized by Play.