<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ThreadNetwork",
  "identifier" : "/documentation/ThreadNetwork/THClient/enableCredentialSharingMode(forExtendedPANID:completion:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "ThreadNetwork"
    ],
    "preciseIdentifier" : "c:objc(cs)THClient(im)enableCredentialSharingModeForExtendedPANID:completion:"
  },
  "title" : "enableCredentialSharingMode(forExtendedPANID:completion:)"
}
-->

# enableCredentialSharingMode(forExtendedPANID:completion:)

Triggers Credential Share mode on a nearby eligible Apple Border Router (tvOS(27.0)).

```
func enableCredentialSharingMode(forExtendedPANID extendedPANID: Data, completion: @escaping @Sendable ((any Error)?) -> Void)
```

```
func enableCredentialSharingMode(forExtendedPANID extendedPANID: Data) async throws
```

## Parameters

`extendedPANID`

The extended PAN identifier of the Thread network.

`completion`

The completion handler the framework calls once credential
sharing mode has started. The `error` parameter is nil on success, or
non-nil if credential sharing mode could not be enabled.

## Discussion

This method scans for Thread credential sharing capable Apple Border Routers, selects an eligible device, and requests to generate an ephemeral 9-digit code and start credential sharing mode.

When you call this method, the ephemeral 9-digit code appears on screen along with a warning message; it is not returned to the caller.

> Concurrency Note: You can call this method from synchronous code using a completion handler,
> as shown on this page, or you can call it as an asynchronous method that has the
> following declarations:
> 
> ```swift
> // Completion handler form:
> func enableCredentialSharingMode(forExtendedPANID extendedPANID: Data, completion: @escaping (Error?) -> Void)
> 
> // Async form (throws on failure):
> func enableCredentialSharingMode(forExtendedPANID extendedPANID: Data) async throws
> ```
> 
> For information about concurrency and asynchronous code in Swift, see <doc://com.apple.documentation/documentation/Swift/calling-objective-c-apis-asynchronously>.

---

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)