<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MediaDevice",
  "identifier" : "/documentation/MediaDevice/MediaDeviceExtension/startDeviceDiscovery()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Media Device"
    ],
    "preciseIdentifier" : "s:11MediaDevice0aB9ExtensionP05startB9DiscoveryyyF"
  },
  "title" : "startDeviceDiscovery()"
}
-->

# startDeviceDiscovery()

Called when a user action requires discovered devices to be displayed.

```
@MainActor func startDeviceDiscovery()
```

## Discussion

Use the `Network`, `WiFiAware`, or `CoreBluetooth` frameworks for service discovery.

> Note: During discovery, your extension will have local area network access, to include direct connections over WiFiAware
> and Bluetooth. It will not be permitted to connect to the internet or addresses outside the local network.

As devices are found, report them to the system by calling
[`foundDevice(_:)`](/documentation/MediaDevice/MediaDeviceRoutingManager/foundDevice(_:)) on the routing manager. When a previously
discovered device is no longer available, call [`lostDevice(_:)`](/documentation/MediaDevice/MediaDeviceRoutingManager/lostDevice(_:)).
If discovery fails unexpectedly, call [`discoveryFailed(_:)`](/documentation/MediaDevice/MediaDeviceRoutingManager/discoveryFailed(_:)).

---

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)