<!--
{
  "availability" : [
    "iOS: 26.2.0 -",
    "iPadOS: 26.2.0 -",
    "macCatalyst: 26.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WiFiInfrastructure",
  "identifier" : "/documentation/WiFiInfrastructure/WINetworkSharingProvider/init(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Wi-Fi Infrastructure"
    ],
    "preciseIdentifier" : "s:18WiFiInfrastructure24WINetworkSharingProviderC3forACSo11ASAccessoryC_tYaKcfc"
  },
  "title" : "init(for:)"
}
-->

# init(for:)

Creates a provider for the specified accessory.

```
init(for accessory: ASAccessory) async throws
```

## Parameters

`accessory`

The accessory that receives the shared networks list.

## Return Value

A new [`WINetworkSharingProvider`](/documentation/WiFiInfrastructure/WINetworkSharingProvider) configured for the specified accessory.

## Discussion

Use this initializer to establish a connection with the system for sharing networks with your accessory.

> Throws: A ``doc://com.apple.wifiinfrastructure/documentation/WiFiInfrastructure/WINetworkSharingError`` for various conditions:
> 
> - ``doc://com.apple.wifiinfrastructure/documentation/WiFiInfrastructure/WINetworkSharingError/accessoryTransportNotSecured``: The accessory doesn’t use a secure Bluetooth transport.
> - ``doc://com.apple.wifiinfrastructure/documentation/WiFiInfrastructure/WINetworkSharingError/accessoryNotAuthorized``: The person hasn’t authorized network data sharing to the accessory.
> - ``doc://com.apple.wifiinfrastructure/documentation/WiFiInfrastructure/WINetworkSharingError/accessoryNotConnected``: The accessory isn’t connected when making this request.
> - ``doc://com.apple.wifiinfrastructure/documentation/WiFiInfrastructure/WINetworkSharingError/wifiNetworkSharingUnsupported``: The device doesn’t support network sharing.

---

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)