<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/ListenerProvider/wifiAware(_:active:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network16ListenerProviderP9WiFiAwareAD011WAPublisherB0VRszrlE04wifiF0_6activeA2F6ActionV_s8DurationVSgtFZ"
  },
  "title" : "wifiAware(_:active:)"
}
-->

# wifiAware(_:active:)

Sets a network listener to publish Wi-Fi Aware services to the selected paired devices.

```
static func wifiAware(_ action: WAPublisherListener.Action, active requestedDuration: Duration? = nil) -> Self
```

## Parameters

`action`

The specific Wi-Fi Aware operation to perform, and the service & devices to perform it on.

`requestedDuration`

Optional duration requested to keep the `NetworkListener` publishing. The default value of `nil` instructs the system to stay active for long enough to guarantee the action completes with all nearby target devices.

## Return Value

a new `ListenerProvider` containing the `.wifiAware()` instruction that will configure a `NetworkListener` as a Wi-Fi Aware publisher.

## Discussion

The code below is an example of how to set the `NetworkListener`:

```swift
NetworkListener(for: .wifiAware(.connecting(to:service, from:.selected(devices))) )
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)