AdAssetDelegate

@objc(AASDKAdAssetDelegate)
public protocol AdAssetDelegate

Informs its delegate of AdAsset networking events. Optional. Can be used to track the status of an AdAsset during buffering / pre-caching, if available.

  • Called when the asset data is fully downloaded.

    Declaration

    Swift

    @objc
    optional func adAssetDidFinishDownloadingData(_ asset: AdAsset)

    Parameters

    asset

    asset owner

  • Called when a new slice of data has been downloaded for the asset. Progress can be calculated as a 0…1 range e.g bytesDownloaded/ bytesExpected

    Declaration

    Swift

    @objc
    optional func adAsset(_ asset: AdAsset, didDownloadDataWith bytesDownloaded: Int64, outOf bytesExpected: Int64)

    Parameters

    asset

    asset owner

    bytesDownloaded

    downloaded data progress so far, in bytes

    bytesExpected

    expected data to download, in bytes

  • Called when an error was encountered during data download for the asset.

    Declaration

    Swift

    @objc
    optional func adAsset(_ asset: AdAsset, downloadingFailedWith error: Error)

    Parameters

    asset

    asset owner

    error

    the error