Type Method 型メソッド

backgroundSessionConfigurationWithIdentifier:

Creates a session configuration object that allows HTTP and HTTPS uploads or downloads to be performed in the background. あるセッション構成設定オブジェクトを作成します、それはHTTPおよびHTTPSアップロードまたはダウンロードにバックグラウンドで実行されることを許可します。

Declaration 宣言

+ (NSURLSessionConfiguration *)backgroundSessionConfigurationWithIdentifier:(NSString *)identifier;

Parameters パラメータ

identifier

The unique identifier for the configuration object. This parameter must not be nil or an empty string. 構成設定オブジェクトに対する特有な識別子。このパラメータは、nilや空の文字列であってはいけません。

Return Value 戻り値

A configuration object that causes the system to perform upload and download tasks in a separate process. ある構成設定オブジェクト、それはシステムにアップロードおよびダウンロードタスクをある別個のプロセスにおいて実行させます。

Discussion 議論

Use this method to initialize a configuration object suitable for transferring data files while the app runs in the background. A session configured with this object hands control of the transfers over to the system, which handles the transfers in a separate process. In iOS, this configuration makes it possible for transfers to continue even when the app itself is suspended or terminated. このメソッドを使って、アプリがバックグラウンドで動作している間にデータファイルを転送するのに適した構成設定オブジェクトを初期化してください。このオブジェクトで構成設定されたセッションは、転送の制御をシステムに渡します、それは転送をある別個のプロセスで取り扱います。iOSでは、この構成設定は、たとえアプリそれ自身が一時停止または終了される場合でさえも、転送が継続できるようにします。

If an iOS app is terminated by the system and relaunched, the app can use the same identifier to create a new configuration object and session and to retrieve the status of transfers that were in progress at the time of termination. This behavior applies only for normal termination of the app by the system. If the user terminates the app from the multitasking screen, the system cancels all of the session’s background transfers. In addition, the system does not automatically relaunch apps that were force quit by the user. The user must explicitly relaunch the app before transfers can begin again. iOSアプリがシステムによって終了されてそして再起動されるならば、そのアプリは同じidentifierを使って新しい構成設定オブジェクトとセッションを作成します、そして終了の時点で進行中だった転送の状態を回復します。この挙動は、システムによるアプリの通常の終了に対してのみ適用されます。ユーザがアプリをマルチタスク画面から終了するならば、システムはそのセッションのもつバックグラウント転送の全てを取り消します。加えて、ユーザによって強制終了されたアプリを、システムは自動的に再起動しません。転送が再び開始できるには、ユーザは明示的にアプリを再起動しなければなりません。

You can configure an background session to schedule transfers at the discretion of the system for optimal performance using the discretionary property. When transferring large amounts of data, you are encouraged to set the value of this property to YES. For an example of using the background configuration, see Downloading Files in the Background. あなたは、バックグラウンドセッションを構成設定して、最善の性能のためにシステムの自由裁量で転送を予定することが、discretionaryプロパティを使って行えます。大量のデータを転送している場合、あなたはこのプロパティの値をYESに設定することを推奨されます。バックグラウンド構成設定を使うことの例として、Downloading Files in the Backgroundを見てください。

See Also 参照

Creating a Session Configuration Object セッション構成設定オブジェクトを作成する