My Environment:
- Device: Mac (Apple Silicon, arm64)
- OS: macOS 15.6.1
Description:
I'm developing a music app and have encountered an issue where I cannot update the playbackState
in MPNowPlayingInfoCenter
after my app loses audio focus to another app. Even though my app correctly calls [MPNowPlayingInfoCenter defaultCenter].playbackState = .paused
, the system's Now Playing UI (Control Center, Lock Screen, AirPods controls) does not reflect this change. The UI remains stuck until the app that currently holds audio focus also changes its playback state.
I've observed this same behavior in other third-party music apps from the App Store, which suggests it might be a system-level issue.
Steps to Reproduce:
Use two most popular music apps in Chinese app Store (NeteaseCloud music and QQ music) (let's call them App A and App B):
- Start playback in App A.
- Start playback in App B. (App B now has audio focus, and App A is still playing).
- Attempt to pause App A via the system's Control Center or its own UI.
- Observed Behavior: App A's audio stream stops, but in the system's Now Playing controls, App A still appears to be playing. The progress bar continues to advance, and the pause button becomes unresponsive.
- If you then pause App B, the Now Playing UI for App A immediately corrects itself and displays the proper "paused" state.
My Questions:
- Is there a specific procedure required to update
MPNowPlayingInfoCenter
when an app is not the current "Now Playing" application? - Is this a known issue or expected behavior in macOS?
- Are there any official workarounds or solutions to ensure the UI updates correctly?