<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/NWListener/Service-swift.struct/init(applicationService:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network10NWListenerC7ServiceV011applicationC0AESS_tcfc"
  },
  "title" : "init(applicationService:)"
}
-->

# init(applicationService:)

Creates a listener for apps that listen for connections from a network device picker.

```
init(applicationService: String)
```

## Parameters

`applicationService`

The name of the application service. This must match the name passed to the network device picker.

## Discussion

Use this initializer to setup a listener for application services.

Apps that register as advertising an application service should always have a listener waiting for a local connection. The system launches your app when the user selects the current device in a <doc://com.apple.documentation/documentation/DeviceDiscoveryUI/DevicePicker> or <doc://com.apple.documentation/documentation/DeviceDiscoveryUI/DDDevicePickerViewController>. Create the listener as soon as your app launches, so that your app can connect with the requesting device.

---

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)