I'm building a React Native app that plays audio using react-native-track-player. Everything works well when the audio is actively playing — I can see the media widget on the lock screen, control playback, and even see track metadata.
However, the problem is that once I pause the audio, the lock screen widget disappears or gets replaced by the system’s default media widget (like Spotify, YouTube, or Apple Music). I want the widget to stay visible and consistent, even when the audio is paused, just like how other music apps behave.
What I’ve tried:
Setting
alwaysPauseOnInterruption: falseand other playback options inupdateOptionsConfiguring capabilities like
Capability.Play,Capability.Pause,Capability.Stop, etc.Setting
compactCapabilitiesSetting up the player with
waitForBuffer: trueand othersetupPlayerconfig optionsTried maintaining audio session in native iOS code to prevent session from ending
But none of these helped — the widget still disappears or switches after pause.
await TrackPlayer.updateOptions({
stopWithApp: false,
capabilities: [
Capability.Play,
Capability.Pause,
Capability.Stop,
Capability.SkipToNext,
Capability.SkipToPrevious,
],
compactCapabilities: [Capability.Play, Capability.Pause],
alwaysPauseOnInterruption: false,
});
Device Info:
iPhone 13, iOS 17.x
App is built using React Native CLI (not Expo)
Using Xcode for builds and debugging
My Goal:
I want the lock screen media widget to remain visible even when audio is paused, like other audio apps (Spotify, YouTube Music, etc.).
Any suggestions or workarounds to keep the lock screen widget persistent during pause would be greatly appreciated!