<!--
{
  "availability" : [
    "iOS: 7.0.0 -",
    "iPadOS: 7.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFAudio",
  "identifier" : "/documentation/AVFAudio/AVAudioSession/mediaServicesWereLostNotification",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "AVFAudio"
    ],
    "preciseIdentifier" : "c:@AVAudioSessionMediaServicesWereLostNotification"
  },
  "title" : "mediaServicesWereLostNotification"
}
-->

# mediaServicesWereLostNotification

A notification the system posts when it terminates the media server.

```
class let mediaServicesWereLostNotification: NSNotification.Name
```

## Discussion

The system posts this notification when the media server first becomes unavailable. Most apps don’t need to subscribe to this notification and should instead subscribe to the [`mediaServicesWereResetNotification`](/documentation/AVFAudio/AVAudioSession/mediaServicesWereResetNotification) notification. However, you can use this notification as a cue to take any appropriate steps to handle requests that come in before the server restarts.

This notification has no <doc://com.apple.documentation/documentation/Foundation/NSNotification/userInfo> dictionary.

The system posts this notification on the main thread.

---

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)