I want to get the history of the songs played on Apple music on Swift3.

Asked 2 years ago, Updated 2 years ago, 35 views

It's iOS.

I would like to know how to get songs that I played in the past through the Apple music app on Swift.

There were many source codes for how to get the songs that were being played, so I understood it somehow, but I didn't know how to get the songs that were played all at once.

swift ios

2022-09-30 14:47

1 Answers

You can retrieve the date and time that you last played in the MPMediaItem lastPlayedDate property.
I think you can get a history of the songs you played by getting all the songs in MPMediaQuery.songs() and sorting them in the order of lastPlayedDated.


2022-09-30 14:47

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.