---
title: requestToBecomeApplicationPrimary()
framework: nowplaying
role: symbol
role_heading: Instance Method
path: nowplaying/mediasession/requesttobecomeapplicationprimary()
---

# requestToBecomeApplicationPrimary()

Attempts to make this session your app’s primary media session.

## Declaration

```swift
@MainActor func requestToBecomeApplicationPrimary() async throws
```

## Mentioned in

Publishing media sessions

## Discussion

Discussion Use this method to signal to the system that this session supplies data and handles commands. note: MediaSessionError.invalidState if the session can’t become active. MediaSessionError.internalFailure if the system couldn’t set the active player.
