---
title: "urlSession(_:)"
framework: swiftui
role: symbol
role_heading: Type Method
path: "swiftui/backgroundtask/urlsession(_:)"
---

# urlSession(_:)

A task that responds to background URL sessions matching the given identifier.

## Declaration

```swift
static func urlSession(_ identifier: String) -> BackgroundTask<Void, Void>
```

## Parameters

- `identifier`: The identifier to match.

## Return Value

Return Value A background task that you can handle with your app or extension.

## See Also

### Responding to URL sessions

- [urlSession](swiftui/backgroundtask/urlsession.md)
- [urlSession(matching:)](swiftui/backgroundtask/urlsession(matching:).md)
