pub struct Network {
    pub advertising_attribution_report_endpoint: Option<String>,
    pub app_transport_security: Option<AppTransportSecurity>,
    pub bonjour_services: Option<Vec<String>>,
    pub sharing_supported: Option<bool>,
}
Expand description

Network

Fields

advertising_attribution_report_endpoint: Option<String>

The URL where Private Click Measurement sends event attribution information.

Include this key in your app to specify where the system sends event attribution data it receives from launched websites that support Private Click Measurement (PCM). The value provided for this key is a string that contains a valid URL that points to a server endpoint. PCM won’t work if your app doesn’t include this key.

For more information on PCM and setting up a server to receive event attribution data, see Introducing Private Click Measurement.

Note

Mac apps built with Mac Catalyst don’t support PCM.

Availability

  • iOS 14.5+

Framework

  • UIKit
app_transport_security: Option<AppTransportSecurity>

A description of changes made to the default security for HTTP connections.

On Apple platforms, a networking feature called App Transport Security (ATS) improves privacy and data integrity for all apps and app extensions. ATS requires that all HTTP connections made with the URL Loading System—typically using the URLSession class—use HTTPS. It further imposes extended security checks that supplement the default server trust evaluation prescribed by the Transport Layer Security (TLS) protocol. ATS blocks connections that fail to meet minimum security specifications. For additional details, see Preventing Insecure Network Connections.

You can circumvent or augment these protections by adding the NSAppTransportSecurity key to your app’s Information Property List file and providing an ATS configuration dictionary as the value. For example, you can:

  • Allow insecure loads for web views while maintaining ATS protections elsewhere in your app using the NSAllowsArbitraryLoadsInWebContent key.
  • Enable additional security features like Certificate Transparency using the NSRequiresCertificateTransparency key, or Certificate Pinning using the NSPinnedDomains key.
  • Reduce or remove security requirements for communication with particular servers using the NSExceptionDomains key.
Important

Always look for ways to improve server security before adding ATS exceptions. Loosening ATS restrictions reduces the security of your app.

All keys in the ATS configuration dictionary are optional, with default values that are suitable for most apps. Keys that define global exceptions apply to all network connections made by your app, except connections to domains specified in the NSExceptionDomains sub-dictionary. That sub-dictionary allows you to separately manage settings for individual domains.

Versioning

ATS operates by default for apps linked against the iOS 9.0 or macOS 10.11 SDKs or later. When you link your app against an older SDK, ATS is disabled no matter which version of operating system your app runs on.

If you specify a value for any of the global exceptions besides NSAllowsArbitraryLoads, then the ATS behavior depends on the version of the OS on which your app runs:

  • iOS 9.0 or macOS 10.11 ATS uses the NSAllowsArbitraryLoads value that you set, or NO by default, and ignores the other global exceptions.
  • iOS 10.0 or later or macOS 10.12 or later ATS ignores the NSAllowsArbitraryLoads value that you set and instead obeys the other key or keys.

This behavior enables you to manage differences between OS versions. You provide a coarse exception (NSAllowsArbitraryLoads) for older versions, and a more targeted exception, like NSAllowsArbitraryLoadsInWebContent, for when it’s available.

Availability

  • iOS 9.0+
  • macOS 10.11+

Framework

  • Security
bonjour_services: Option<Vec<String>>

Bonjour service types browsed by the app.

The value associated with this key is an array of strings that represent Bonjour service types. Include all service types that your app expects to use. Bonjour service type strings look like _ipp._tcp, and _myservice._udp, where the first substring identifies the application protocol and the second identifies the transport protocol.

Availability

  • iOS 14.0+
  • macOS 11.0+
  • tvOS 14.0+

Framework

  • Network
sharing_supported: Option<bool>

A Boolean value that indicates your app supports CloudKit Sharing.

If your app supports CloudKit Sharing, add this key to your app’s Info.plist file with a value of true. This tells the system to launch your app when the user taps or clicks a share’s URL. For example, one they receive in an email or an iMessage from the share’s owner.

Before your app launches, CloudKit verifies that the user has an active iCloud account and, for private shares, that it matches their participant details. Following successful verification, CloudKit provides the share’s metadata to your app’s scene, or application, delegate. The method it calls varies by platform and app configuration. For more information, see CKShare.Metadata.

To indicate that your app supports CloudKit Sharing:

  1. Select your project’s Info.plist file in the Project navigator in Xcode.
  2. Click the Add button (+) next to any key in the property list editor and press Return. 3. Type the key name CKSharingSupported.
  3. Choose Boolean from the pop-up menu in the Type column.
  4. Choose YES from the pop-up menu in the Value column.
  5. Save your changes.

Availability

  • iOS 10.0+
  • macOS 10.12+

Framework

  • CloudKit

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.