Instance Property インスタンスプロパティ

allowsConstrainedNetworkAccess

A Boolean value that indicates whether connections may use the network when the user has specified Low Data Mode. ユーザがLow Data Modeを指定する場合に接続がネットワークを使うかもしれないかどうかを指し示すブール値。

Declaration 宣言

var allowsConstrainedNetworkAccess: Bool { get }

Discussion 議論

In iOS 13 and later, users can set their device to use Low Data Mode as one of the Cellular Data Options in the Settings app. Users can turn on Low Data Mode to reduce your app’s network data usage. This property controls the request’s behavior when the user turns on Low Data Mode. If there are no nonconstrained network interfaces available and the request’s allowsConstrainedNetworkAccess property is false, any connection created from the request fails. In this case, the error provided when the connection fails has a networkUnavailableReason property whose value is NSURLErrorNetworkUnavailableReason.constrained. iOS 13以降では、ユーザは彼らのデバイスを、「省データモード」を「通信のオプション」の1つとして使うように設定することが「設定」アプリにおいて可能です。ユーザは、「省データモード」を入りにして、あなたのアプリのネットワークデータ利用を減らせます。このプロパティは、ユーザが「省データモード」を入りにする時に、リクエストの挙動を制御します。利用可能な非制約ネットワークインターフェイスがない、そしてリクエストのもつallowsConstrainedNetworkAccessプロパティがfalseならば、リクエストから作成されたどんな接続も失敗します。この場合、接続が失敗する場合に提供されたエラーは、networkUnavailableReasonプロパティをもち、それの値はNSURLErrorNetworkUnavailableReason.constrainedです。

Limit your app’s of use of constrained network access to user-initiated tasks, and put off discretionary tasks until a nonconstrained interface becomes available. あなたのアプリのもつ制約付ネットワークアクセス利用を、ユーザ開始タスクに制限してください、そして自由裁量タスクを延期してください、非制約インターフェイスが利用可能になるまで。

See Also 参照

Supporting Limited Modes 制限モードをサポートする