---
title: backgroundSessionRequiresSharedContainer
framework: foundation
role: symbol
role_heading: Type Property
path: foundation/urlerror/backgroundsessionrequiressharedcontainer
---

# backgroundSessionRequiresSharedContainer

The shared container identifier of the URL session configuration is needed but hasn’t been set.

## Declaration

```swift
static var backgroundSessionRequiresSharedContainer: URLError.Code { get }
```

## Discussion

Discussion To use a URLSession to perform background uploading or downloading in an app extension, you coordinate with the host app using a shared container. The app extension must set the sharedContainerIdentifier of the URL session’s configuration to the shared container’s identifier. See Performing Uploads and Downloads in App Extension Essentials for more information.

## See Also

### Error codes

- [appTransportSecurityRequiresSecureConnection](foundation/urlerror/apptransportsecurityrequiressecureconnection.md)
- [backgroundSessionInUseByAnotherProcess](foundation/urlerror/backgroundsessioninusebyanotherprocess.md)
- [backgroundSessionWasDisconnected](foundation/urlerror/backgroundsessionwasdisconnected.md)
- [badServerResponse](foundation/urlerror/badserverresponse.md)
- [badURL](foundation/urlerror/badurl.md)
- [callIsActive](foundation/urlerror/callisactive.md)
- [cancelled](foundation/urlerror/cancelled.md)
- [cannotCloseFile](foundation/urlerror/cannotclosefile.md)
- [cannotConnectToHost](foundation/urlerror/cannotconnecttohost.md)
- [cannotCreateFile](foundation/urlerror/cannotcreatefile.md)
- [cannotDecodeContentData](foundation/urlerror/cannotdecodecontentdata.md)
- [cannotDecodeRawData](foundation/urlerror/cannotdecoderawdata.md)
- [cannotFindHost](foundation/urlerror/cannotfindhost.md)
- [cannotLoadFromNetwork](foundation/urlerror/cannotloadfromnetwork.md)
- [cannotMoveFile](foundation/urlerror/cannotmovefile.md)
