---
title: sharedContainerIdentifier
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/urlsessionconfiguration/sharedcontaineridentifier
---

# sharedContainerIdentifier

The identifier for the shared container into which files in background URL sessions should be downloaded.

## Declaration

```swift
var sharedContainerIdentifier: String? { get set }
```

## Discussion

Discussion To create a URL session for use by an app extension, set this property to a valid identifier for a container shared between the app extension and its containing app. important: If you try to create a URL session from your app extension but fail to set this property to a valid value, the URL session is invalidated upon creation. For information about app extensions, see App Extension Programming Guide.

## See Also

### Related Documentation

- [NSURLErrorBackgroundSessionRequiresSharedContainer](foundation/nsurlerrorbackgroundsessionrequiressharedcontainer-swift.var.md)

### Setting general properties

- [identifier](foundation/urlsessionconfiguration/identifier.md)
- [httpAdditionalHeaders](foundation/urlsessionconfiguration/httpadditionalheaders.md)
- [networkServiceType](foundation/urlsessionconfiguration/networkservicetype.md)
- [allowsCellularAccess](foundation/urlsessionconfiguration/allowscellularaccess.md)
- [timeoutIntervalForRequest](foundation/urlsessionconfiguration/timeoutintervalforrequest.md)
- [timeoutIntervalForResource](foundation/urlsessionconfiguration/timeoutintervalforresource.md)
- [waitsForConnectivity](foundation/urlsessionconfiguration/waitsforconnectivity.md)
- [usesClassicLoadingMode](foundation/urlsessionconfiguration/usesclassicloadingmode.md)
