In-App Products Module for iOS

API Docs for: 1.0.2
Show:

Download Class

Module: Readme

A Download object represents downloadable content associated with a product. When you create a product in iTunes Connect, you can associate one or more pieces of downloadable content with it. Then, at runtime, when a product is purchased by a user, your app uses Download objects to download the content from the App Store.

Properties

contentID

String read-only

Available since 1.0.0

A string that uniquely identifies the downloadable content.

contentLength

Number read-only

Available since 1.0.0

The length of the downloadable content, in bytes.

contentURL

String read-only

Available since 1.0.0

The local location of the downloaded file.

The value of this property is valid only when the state property is set to DOWNLOAD_STATE_FINISHED.

The URL becomes invalid after the purchase associated with the download is completed.

contentVersion

String read-only

Available since 1.0.0

A string that identifies which version of the content is available for download. The version string must be formatted as a series of integers separated by periods.

errorCode

Number read-only

Available since 1.0.0

The code of the error that prevented the content from being downloaded.

errorMessage

String read-only

Available since 1.0.0

The error message associated with a failed download.

progress

Number read-only

Available since 1.0.0

A value that indicates how much of the file has been downloaded.

The value of this property is a floating point number between 0.0 and 1.0, inclusive, where 0.0 means no data has been download and 1.0 means all the data has been downloaded. Typically, your app uses the value of this property to update a user interface element, such as a progress bar, that displays how much of the file has been downloaded.

Do not use the value of this property to determine whether the download has completed. Instead, use the state property.

purchase

Purchase read-only

Available since 1.0.0

state

String read-only

Available since 1.0.0

timeRemaining

Number read-only

Available since 1.0.0

An estimated time, in seconds, to finish downloading the content.

The system attempts to estimate how long it will take to finish downloading the file. If it cannot create a good estimate, the value of this property is set to DOWNLOAD_TIME_UNKNOWN,