Contents

getStatusRelativeToAssetPack:completionHandler:

Gets an asset pack’s status.

Declaration

- (void) getStatusRelativeToAssetPack:(BAAssetPack *) assetPack completionHandler:(void (^)(BAAssetPackStatus status, NSError *error)) completionHandler;

Parameters

  • assetPack:

    The asset pack.

  • completionHandler:

    A block that receives the asset pack’s status or an error if one occurs.

Discussion

This method checks whether any version of the specified asset pack is currently downloaded. If one is, then it determines the version relationship between the downloaded asset pack and the specified asset pack. If they have different version numbers, then the status value that it passes to completionHandler will contain BAAssetPackStatusOutOfDate. The status value will contain BAAssetPackStatusUpdateAvailable only if the relevant asset pack on the server hasn’t been further updated since the initialization of the provided BAAssetPack instance.

For example, consider the following sequence of events, assuming that version 1 of the relevant asset pack is already available locally:

  1. Your application calls getAssetPackWithIdentifier:completionHandler: to obtain a BAAssetPack instance.

  2. The asset pack is updated to version 2 on the server.

  3. Your application calls this method, passing the BAAssetPack instance from step 1.

In this case, the status value will indicate that the downloaded asset pack is up to date. Generally, you shouldn’t need to handle this type of situation explicitly because the system automatically polls for updates periodically in the background.

This method doesn’t automatically trigger any downloads, updates, or removals.