On iOS, the lock screen controls should disappear after the last track ends.
Instead, they remain visible.
I tried adding the following to RNTrackPlayer.swift inside player.event.playbackEnd.addListener
self.player.nowPlayingInfoController.clear()
As suggested here: https://github.com/jorgenhenrichsen/SwiftAudio/issues/83
However, this clears out the info but the controls remain in place.
Have been looking at a similar issue and setting nowPlayingInfo to an empty dictionary seems to do the trick: MPNowPlayingInfoCenter.default().nowPlayingInfo = [:].
Are you finding that your suggestion works differently than self.player.nowPlayingInfoController.clear()? Where did you put that line?
Yes. It clears the audio player including controls.
Currently calling it in the reset function in RNTrackPlayer.swift within the DispatchQueue.main.async block.
@Thomas0c do the lock screen control disappear if you are watching them when the queue ends?
For me everything works as expected, UNLESS I have the lock screen controls visible when the queue ends. In this case, using either MPNowPlayingInfoCenter.default().nowPlayingInfo = [:] or self.player.nowPlayingInfoController.clear() causes the controls to reset to a "default" state. (see attached)

At this point, if I turn the screen off and back on, the controls go away as they should.
Did someone solve this issue? Is this issue still in tracking?
Any update on this?
Here is the destroy method which only prints a message in the log
@objc(destroy)
public func destroy() {
print("Destroying player")
}
This is not a perfect solution but i found a workaround that updating the options after resetting the player works for me.
```
await RNTrackPlayer.reset()
await RNTrackPlayer.updateOptions({ stopWithApp: true,
capabilities: [
Capability.Play,
Capability.Stop,
Capability.SkipToNext,
Capability.SkipToPrevious,
Capability.Pause
]})
Most helpful comment
This is not a perfect solution but i found a workaround that updating the options after resetting the player works for me.
```
await RNTrackPlayer.reset()
await RNTrackPlayer.updateOptions({ stopWithApp: true,
capabilities: [
Capability.Play,
Capability.Stop,
Capability.SkipToNext,
Capability.SkipToPrevious,
Capability.Pause
]})