I'm struggling a bit with iOS/Apple Music/Playlists. I have the ability to:
- Create a playlist with a UUID (GUID)
- Get the same playlist with the given UUID
- List all of my playlists
To get a list of my playlists:
MPMediaQuery *myPlaylistsQuery = [MPMediaQuery playlistsQuery];
NSArray *playlists = [myPlaylistsQuery collections];
for (MPMediaPlaylist *playlist in playlists) {
NSLog (@"%@", [playlist valueForProperty: MPMediaPlaylistPropertyName]);
}
To get the playlist via the UUID (where metaData
is empty):
[[MPMediaLibrary defaultMediaLibrary] getPlaylistWithUUID:playlistUUID creationMetadata:metaData completionHandler:^(MPMediaPlaylist * _Nullable playlist, NSError * _Nullable error) {
NSLog (@"%@", [playlist.name]);
}];
The Problem (Part 1):
I want to be able to list all of my playlists then get one of them ideally with the UUID but that doesn't seem to be returned. I can see a PersistentID
but that can't be used to retrieve the playlist via the 'get' method.
The Problem (Part 2):
I also want to be able to retrieve the 'share' link for a given playlist. This doesn't seem to be a way of accessing this at all. Am I right in thinking it isn't available via code?