<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "DeviceDiscoveryUI",
  "identifier" : "/documentation/DeviceDiscoveryUI/DevicePairingView/init(_:access:label:fallback:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "DeviceDiscoveryUI",
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:024_DeviceDiscoveryUI_SwiftC00A11PairingViewV_6access5label8fallbackACyxq_G7Network16ListenerProvider_p_0abC008DDDeviceE6AccessVxyXEq_yXEtcfc"
  },
  "title" : "init(_:access:label:fallback:)"
}
-->

# init(_:access:label:fallback:)

Creates a `DevicePairingView` which, when pressed, will display a local device advertiser interface.

```
@MainActor @preconcurrency init(_ listenerProvider: any ListenerProvider, access: DDDevicePairingAccess = .default, @ViewBuilder label: () -> Label, @ViewBuilder fallback: () -> Fallback)
```

## Parameters

`listenerProvider`

A ListenerProvider which provides information about the listener to use to advertise.

`access`

The level of access the app receives for the endpoint selected by the user.

`label`

A view that describes the action of requesting device advertising if it is supported.

`fallback`

A view that describes the alternative action when device advertising is not supported.

## Discussion

For example:

```
DevicePairingView(listenerProvider) {
	Text("Starting advertising to local devices")
} fallback: {
	Text("Advertising not available")
}
```

---

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)