---
title: startDeviceDiscovery()
framework: mediadevice
role: symbol
role_heading: Instance Method
path: mediadevice/mediadeviceextension/startdevicediscovery()
---

# startDeviceDiscovery()

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

## Declaration

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

## Mentioned in

Creating a media device extension

## Discussion

Discussion Use the Network, WiFiAware, or CoreBluetooth frameworks for service discovery. As devices are found, report them to the system by calling foundDevice(_:) on the routing manager. When a previously discovered device is no longer available, call lostDevice(_:). If discovery fails unexpectedly, call discoveryFailed(_:).
