---
title: saveToPreferences()
framework: networkextension
role: symbol
role_heading: Instance Method
path: networkextension/nehotspotmanager/savetopreferences()
---

# saveToPreferences()

Saves the HotspotManager configuration in the Network Extension preferences.

## Declaration

```swift
final func saveToPreferences() async throws
```

## Discussion

Discussion Only call this method after previously calling loadFromPreferences() to load the configuration. This method throws NEHotspotManager.Error value asynchronously on failure.

## See Also

### Managing the saved configuration

- [loadFromPreferences()](networkextension/nehotspotmanager/loadfrompreferences().md)
- [removeFromPreferences()](networkextension/nehotspotmanager/removefrompreferences().md)
