wifiAware(_:active:)
Sets a network listener to publish Wi-Fi Aware services to the selected paired devices.
Declaration
static func wifiAware(_ action: WAPublisherListener.Action, active requestedDuration: Duration? = nil) -> SelfParameters
- action:
The specific Wi-Fi Aware operation to perform, and the service & devices to perform it on.
- requestedDuration:
Optional duration requested to keep the
NetworkListenerpublishing. The default value ofnilinstructs 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:
NetworkListener(for: .wifiAware(.connecting(to:service, from:.selected(devices))) )