Are Assets Packs actually downloaded in the background?

Hello,

I have a question about when are asset packs actually updated?

For Essential Asset Packs, this only during the keys included in the pack? As in, only when the app is installed for
firstInstallation. And only when there's an app update for subsequentUpdate?

For On Demand Asset Packs, is this only when AssetPackManager.shared.checkForUpdates() is called?

Also, are any asset packs ever actually updated in the background? For example, if an On Demand Asset Pack has an update pushed, can the device automatically fetch and download the pack overnight?

Or is updating limited to only when the app is active?

Answered by Frameworks Engineer in 868869022

For Essential Asset Packs, this only during the keys included in the pack? As in, only when the app is installed for firstInstallation. And only when there's an app update for subsequentUpdate?

Those elements in the installationEventTypes array determine only when the asset pack can be initially downloaded. For example, an asset pack with an essential download policy and just subsequentUpdate (but not firstInstallation) in its installationEventTypes array would be newly downloaded for a user only when the user next installs an update to the main app following the asset pack’s first public release. This, of course, requires that you push an update to the main app at some point. The installationEventTypes array does not apply to the behavior of updates to the asset pack itself. In all cases, the system will keep downloaded asset packs up to date in the background, no matter how and when each asset pack was initially downloaded.

For On Demand Asset Packs, is this only when AssetPackManager.shared.checkForUpdates() is called?

No; the system keeps on-demand asset packs, like all asset packs, up to date automatically in the background. AssetPackManager.checkForUpdates() exists for if for some reason you need to ensure while your app is running that its asset packs be fully up to date with what’s available on the server since the automatic, background updates aren’t immediate.

Also, are any asset packs ever actually updated in the background? For example, if an On Demand Asset Pack has an update pushed, can the device automatically fetch and download the pack overnight?

Yes, the system keeps all asset packs, including on-demand asset packs, up to date in the background automatically. There’s a system-wide scheduler that determines when to poll for updates and when to download them after discovery, such as overnight.

Or is updating limited to only when the app is active?

Nope, asset-pack updates don’t require that your app be active.

I hope that this helps!

Accepted Answer

For Essential Asset Packs, this only during the keys included in the pack? As in, only when the app is installed for firstInstallation. And only when there's an app update for subsequentUpdate?

Those elements in the installationEventTypes array determine only when the asset pack can be initially downloaded. For example, an asset pack with an essential download policy and just subsequentUpdate (but not firstInstallation) in its installationEventTypes array would be newly downloaded for a user only when the user next installs an update to the main app following the asset pack’s first public release. This, of course, requires that you push an update to the main app at some point. The installationEventTypes array does not apply to the behavior of updates to the asset pack itself. In all cases, the system will keep downloaded asset packs up to date in the background, no matter how and when each asset pack was initially downloaded.

For On Demand Asset Packs, is this only when AssetPackManager.shared.checkForUpdates() is called?

No; the system keeps on-demand asset packs, like all asset packs, up to date automatically in the background. AssetPackManager.checkForUpdates() exists for if for some reason you need to ensure while your app is running that its asset packs be fully up to date with what’s available on the server since the automatic, background updates aren’t immediate.

Also, are any asset packs ever actually updated in the background? For example, if an On Demand Asset Pack has an update pushed, can the device automatically fetch and download the pack overnight?

Yes, the system keeps all asset packs, including on-demand asset packs, up to date in the background automatically. There’s a system-wide scheduler that determines when to poll for updates and when to download them after discovery, such as overnight.

Or is updating limited to only when the app is active?

Nope, asset-pack updates don’t require that your app be active.

I hope that this helps!

Thank you for those detailed answers!

Are Assets Packs actually downloaded in the background?
 
 
Q