WWDC.ai

Unlock in-game content with StoreKit and Background Assets

Use new Apple Unity plug-ins for StoreKit and Background Assets to sell, unlock, localize, download, and test game content on Apple platforms.

Watch on Apple Developer

TL;DR

  • Managed Background Assets can reduce initial game size by downloading asset packs only when needed; Apple-hosted assets support up to 200 GB per App Store app and localized asset packs in iOS 27.
  • Localized asset packs use language tags in asset pack manifests, deliver only the player's preferred language when available, and fall back to a closest match or the app's primary language.
  • A new Steam Asset Converter in xcrun ba-package converts Steam depots into Background Assets manifests and asset pack archives for Apple-platform distribution.
  • New Apple Unity plug-ins for StoreKit and Background Assets expose C# APIs for fetching products, purchasing, listening for transactions, ensuring asset pack availability, and testing with Xcode 27.

Background Assets for game content delivery

Managed Background Assets lets games avoid bundling all audio, video, textures, machine learning models, and level content up front. The system downloads asset packs when needed, saving player download time and device storage.

For App Store apps, Apple can host up to 200 GB of assets per app as part of Developer Program membership. Apple-Hosted Background Assets is available starting with iOS, iPadOS, macOS, tvOS, and visionOS 26.

  • Use Background Assets for content that is only needed at specific moments in the game.
  • Use Apple-hosted asset packs to reduce app binary size and offload hosting for large assets.
  • For deeper setup and integration details, the session points to "Discover Apple-Hosted Background Assets" from WWDC25.

Localized asset packs

In iOS 27, Managed Background Assets adds localized asset packs. The system reads the player's preferred language from Settings and downloads only the asset pack for that language when available.

Fallback is automatic: if an exact regional language pack is not provided, the system can use a base-language match such as English-US for English-UK. If no suitable language variant exists, it falls back to the app's primary language.

  • Add a language tag to each localized asset pack manifest JSON file.
  • Provide localized packs only for languages you support; the system handles matching and fallback.
  • This is most useful for language-heavy content such as voice-over, video, tutorials, and localized media.

Asset pack manifest for a localized asset pack

Add a language tag such as en-US to the asset pack manifest so the system can select the appropriate localized pack.

// Asset pack manifest
{
  "assetPackID": "voice-english",
  "downloadPolicy": { /* ... */ },
  "language": "en-US",
  "sourceRoot": ".",
  "fileSelectors": [ /* ... */ ],
  "platforms": [ /* ... */ ]
  // ...
}

Convert Steam depots to Background Assets

Games already using Steam depots can migrate asset packaging workflows to Apple platforms with the new Steam Asset Converter. On macOS, install Xcode 27 and run xcrun ba-package convert to produce an asset pack manifest from a Steam manifest build script.

After generating the manifest, run ba-package again to create an asset pack archive that can be used by the game. The same conversion tool is described as coming soon to Linux and Windows.

  • Pass an asset pack ID, an optional language ID, and the desired download policy.
  • Use the Steam manifest build script as input.
  • Package the resulting manifest into an asset pack archive before shipping or testing.

Convert a Steam depot to an asset pack manifest

Creates a Background Assets manifest from a Steam depot manifest build script.

xcrun ba-package convert \
  --asset-pack-id voice-english \
  --l en-US \
  --on-demand \
  voice-english.vdf \
  -o voice-english.json

Convert an asset pack manifest to an archive

Packages the generated manifest into an asset pack archive.

xcrun ba-package voice-english.json -o voice-english.aar

Apple Unity plug-ins for StoreKit and Background Assets

Two new Apple Unity plug-ins join the Apple Unity plug-in portfolio: StoreKit and Background Assets. They are available on GitHub alongside the existing Apple Unity plug-ins and expose C# Unity APIs that bridge to the native Apple frameworks.

To build, package, and test the plug-ins, use Xcode 27, Python 3, and Unity 2022 LTS or later. The plug-ins are built with the same Python script used for other Apple Unity plug-ins.

  • Use the StoreKit plug-in to fetch products, initiate purchases, verify transactions, and finish transactions.
  • Use Transaction.Updates to handle purchases or transaction changes that happen outside the app or on other devices.
  • For consumables, handle verified, non-revoked transactions inline; for non-consumables and subscriptions, use current entitlements as the source of truth.
  • Use the Background Assets plug-in to ensure purchased asset packs are locally available and monitor download progress.

Fetch and purchase products with the StoreKit plug-in

Fetches App Store products from Unity, starts the system purchase flow, verifies the transaction, unlocks content, and finishes the transaction.

using UnityEngine;
using Apple.StoreKit;

async void Start() {
    var products = await Product.FetchProducts(new[] { "com.thecoast.capecod" });
}

async void Purchase(Product product) {
    var result = await product.Purchase();
    if (result.Result == PurchaseResult.ResultEnum.Success &&
        result.TransactionVerification.IsVerified) {
        // Unlock access to purchased content
        result.TransactionVerification.SafePayload.Finish();
    }
}

Download asset packs with the Background Assets plug-in

Finds an asset pack from the manifest, observes download status, ensures local availability, and starts content once the assets are present.

using Apple.BackgroundAssets;
using UnityEngine;

async void LoadTutorial(string language) {
    try {
        string assetPackId = $"tutorial-{language}";
        AssetPackManifest manifest = await AssetPackManager.GetManifestAsync();
        AssetPack assetPack = manifest.GetAssetPack(assetPackId);

        CancellationTokenSource tokenSource = new CancellationTokenSource();
        _ = Task.Run(async () => {
            await foreach (AssetPackManager.DownloadStatusUpdate statusUpdate in
                AssetPackManager.DownloadStatusUpdatesAsync(assetPackId)) {
                // Update download progress in UI
            }
        }, tokenSource.Token);

        await AssetPackManager.EnsureLocalAvailabilityOfAssetPackAsync(assetPack);
        tokenSource.Cancel();
        // Start tutorial with the locally available assets
    } catch (Exception exception) {
        // Handle the exception
    }
}

Testing and App Store presentation

After installing the Unity plug-ins, export the Unity project to Xcode. StoreKit Testing in Xcode can use a StoreKit configuration file with test products, while the Background Assets mock server can serve packaged asset packs during a debug session.

In the scheme's Run settings, choose the StoreKit configuration file and select the folder containing packaged asset packs. When running in Xcode 27, the Background Assets mock server starts and attaches to the debug session. Sandbox testing remains available for products configured in App Store Connect.

The session also highlights new App Store and Apple Games app presentation assets: product page header visuals and search-result images and videos. In iOS 27, players see a redesigned system payment sheet that works well in landscape mode for games.

  • Use StoreKit configuration files for local purchase testing.
  • Use the Background Assets mock server with packaged asset packs during Xcode debugging.
  • Use App Store Connect for sandbox testing and for uploading localized asset packs.
  • Consider new image and video assets for App Store search results and the Apple Games app.

Resources

Unofficial, not associated with Apple. BySuperwall

On this page

Ask AI