Class: SKDownload

Inherits:
NSObject show all

Overview

A SKDownload 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 SKDownload objects to download the content from the App Store.

Instance Attribute Summary (collapse)

Method Summary

Methods inherited from NSObject

#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version

Constructor Details

This class inherits a constructor from NSObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NSObject

Instance Attribute Details

- (String) contentIdentifier (readonly)

A string that uniquely identifies the downloadable content. (read-only) Each piece of downloadable content associated with a product has its own unique identifier. The content identifier is specified in iTunes Connect when you add the content.

Returns:

- (Integer) contentLength (readonly)

The length of the downloadable content, in bytes. (read-only)

Returns:

- (NSURL) contentURL (readonly)

The local location of the downloaded file. (read-only) The value of this property is valid only when the downloadState property is set to SKDownloadStateFinished. The URL becomes invalid after the transaction object associated with the download is finalized.

Returns:

- (String) contentVersion (readonly)

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

Returns:

- (SKDownloadState) downloadState (readonly)

The current state of the download object. (read-only) After you queue a download object, the payment queue object calls your transaction observer when the state of the download object changes. Your transaction observer should read the downloadState property and use it to determine how to proceed. For more information on the different states, see “Download States”.

Returns:

  • (SKDownloadState)

- (NSError) error (readonly)

The error that prevented the content from being downloaded. (read-only) The value of this property is valid only when the downloadState property is set to SKDownloadStateFailed.

Returns:

- (Float) progress (readonly)

A value that indicates how much of the file has been downloaded. (read-only) 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 downloadState property.

Returns:

- (NSTimeInterval) timeRemaining (readonly)

An estimated time, in seconds, to finish downloading the content. (read-only) 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 Values”.

Returns:

  • (NSTimeInterval)

- (SKPaymentTransaction) transaction (readonly)

The transaction associated with the downloadable file. (read-only) A download object is always associated with a payment transaction. The download object may only be queued after payment is processed and before the transaction is finished.