<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkExtension",
  "identifier" : "/documentation/NetworkExtension/NEHotspotManager",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Network Extension"
    ],
    "preciseIdentifier" : "s:16NetworkExtension16NEHotspotManagerC"
  },
  "title" : "NEHotspotManager"
}
-->

# NEHotspotManager

A class that you use to enable or disable the hotspot evaluation and authentication provider extensions.

```
final class NEHotspotManager
```

## Overview

Use an `NEHotspotManager` to perform custom authentication of Wi-Fi hotspots in app extensions rather than in an app.
Using sandboxed extensions is more performant and secure than performing hotspot authentication in an app.

The manager is responsible for two extensions:

- An [`NEHotspotEvaluationProvider`](/documentation/NetworkExtension/NEHotspotEvaluationProvider) to evaluate detected Wi-Fi hotspots.
- An [`NEHotspotAuthenticationProvider`](/documentation/NetworkExtension/NEHotspotAuthenticationProvider) to authenticate with evaluated hotspots.

### Implementing an evaluation provider

The [`NEHotspotEvaluationProvider`](/documentation/NetworkExtension/NEHotspotEvaluationProvider) managed by this class can receive a [`NEHotspotHelperCommandType.filterScanList`](/documentation/NetworkExtension/NEHotspotHelperCommandType/filterScanList) command at any time.
Respond to this by indicating which of the listed networks your provider can confidently handle.

When the device initially joins a network, the hotspot helper enters the *evaluating* state.
In this state, each [`NEHotspotEvaluationProvider`](/documentation/NetworkExtension/NEHotspotEvaluationProvider) instance receives a command of type [`NEHotspotHelperCommandType.evaluate`](/documentation/NetworkExtension/NEHotspotHelperCommandType/evaluate).
If one or more evaluation providers indicates it can handle the network, the hotspot helper chooses the one with the highest confidence level before entering the *authenticating* state.
If no evaluation provider instance claims the network, the state machine enters the *authenticated* state.

### Using the state machine during authentication

In the authenticating state, your [`NEHotspotAuthenticationProvider`](/documentation/NetworkExtension/NEHotspotAuthenticationProvider) receives the [`NEHotspotHelperCommandType.authenticate`](/documentation/NetworkExtension/NEHotspotHelperCommandType/authenticate) command.
At this point, the provider performs any network processing needed to make the network available for general network traffic.
If authentication is successful, your provider calls [`createResponse(_:)`](/documentation/NetworkExtension/NEHotspotHelperCommand/createResponse(_:)) on the command to create a [`NEHotspotHelperResult.success`](/documentation/NetworkExtension/NEHotspotHelperResult/success) response and returns it.

While in the authenticating state, if your authentication provider determines that it needs interaction from the person using the device, create an alert with <doc://com.apple.documentation/documentation/UserNotifications/UNUserNotificationCenter>, and respond to the command with an [`NEHotspotHelperResult.uiRequired`](/documentation/NetworkExtension/NEHotspotHelperResult/uiRequired) response.
This transitions the state machine to a *Presenting UI* state, and the provider receives a command of type [`NEHotspotHelperCommandType.presentUI`](/documentation/NetworkExtension/NEHotspotHelperCommandType/presentUI).
The extension runs in the background in this state until the app collects the needed information from the person.
After the app uses the information to complete the authentication, return a success response to enter the authenticated state.

After a successful authentication, the network enters a *maintaining* state when the network is joined again.
In this state, the provider periodically receives the [`NEHotspotHelperCommandType.maintain`](/documentation/NetworkExtension/NEHotspotHelperCommandType/maintain) command.
To process this command, determine if the network remains able to carry general network traffic, and return success if this is the case.
If not, and the network again requires authentication, return an [`NEHotspotHelperResult.authenticationRequired`](/documentation/NetworkExtension/NEHotspotHelperResult/authenticationRequired) result.

## Topics

### Accessing the shared instance

[`shared`](/documentation/NetworkExtension/NEHotspotManager/shared)

The shared instance of the hotspot manager class.

### Accessing provider properties

[`isEnabled`](/documentation/NetworkExtension/NEHotspotManager/isEnabled)

A Boolean value that indicates whether the configuration is enabled.

[`evaluationProviderBundleIdentifier`](/documentation/NetworkExtension/NEHotspotManager/evaluationProviderBundleIdentifier)

The bundle identifier of the hotspot evaluation provider.

[`authenticationProviderBundleIdentifier`](/documentation/NetworkExtension/NEHotspotManager/authenticationProviderBundleIdentifier)

The bundle identifier of the hotspot authentication provider.

### Authenticating with Safari domains

[`safariDomains`](/documentation/NetworkExtension/NEHotspotManager/safariDomains)

An array of domain strings for use with Safari-based hotspot authentication.

### Identifying pre-evaluated Wi-Fi networks

[`evaluatedSSIDs`](/documentation/NetworkExtension/NEHotspotManager/evaluatedSSIDs)

An array of pre-evaluated Wi-Fi SSID strings.

### Managing the saved configuration

[`loadFromPreferences()`](/documentation/NetworkExtension/NEHotspotManager/loadFromPreferences())

Loads the hotspot manager configuration from the Network Extension preferences.

[`saveToPreferences()`](/documentation/NetworkExtension/NEHotspotManager/saveToPreferences())

Saves the HotspotManager configuration in the Network Extension preferences.

[`removeFromPreferences()`](/documentation/NetworkExtension/NEHotspotManager/removeFromPreferences())

Removes the hotspot manager configuration from the Network Extension preferences.

### Identifying manager errors

[`Error`](/documentation/NetworkExtension/NEHotspotManager/Error)

An enumeration of errors thrown by hotspot manager methods.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)