Is there a way to show the these labels in our own applications? If so, is this something we can search on and filter on?
Post
Replies
Boosts
Views
Activity
I dont see anything in the documentation about how to add Tags in EventKit. Is that available to us to use and I just missed it in the documentation?
Is there a way to use the MusicLibraryRequest to get the users loved songs, playlists, albums and artists? I don't see a way in documentation but maybe I am missing it.
Thanks,
Dan
Hello,
I am working a music app with the new MusicKit API and I am not sure how to fix my current warning. I have the following methods to get recently played songs and another used to insert a new song into the queue after the current song. Both methods work but I am receiving the purple warning:
“Publishing changes from background threads is not allowed; make sure to publish values from the main thread (via operators like receive(on:)) on model updates.”
func getRecentlyPlayed(){
let request = MusicRecentlyPlayedRequest()
Task{
let response = try await request.response()
let musicPlayer = ApplicationMusicPlayer.shared
musicPlayer.queue = ApplicationMusicPlayer.Queue(for: response.items)
try await musicPlayer.prepareToPlay()
}
}
func insertNextInQueue(items: MusicItemCollection) {
Task{
let musicPlayer = ApplicationMusicPlayer.shared
try await musicPlayer.queue.insert(items, position: .afterCurrentEntry)
}
}
I have tried everything to force the insert to happen on the main thread but am not able to get the warning to go away. Despite the warning, the insert method works and doesn’t seem to impact my application at all. I am not sure what else to do at this point. Any help or suggestions would be much appreciated.
Thanks,
Dan