iosswiftapple-musicapple-musickit

How to get an ID for an Apple Music Playlist


I am currently making a swift app that creates a playlist for a user via MusicKit / the Apple Music API. It creates this playlist in the user's library and returns an ID of the format p.XXXXXXXX. I would like to then open up the iOS Music App and display the newly created playlist to the user by opening up an itunes.apple.com/us/playlist/XXXXXX?app=music link. However, the IDs for this URL all are of the format pl.XXXXXXXX. The Mac iTunes app has a Share Playlist button that can get the pl.XXXXXXX id for the playlist, but how can I get this ID in swift when the Apple Music API only returns the p.XXXXXXXXXX id? Thanks!


Solution

  • For anyone who comes across this question in the future:

    I reached out to Apple for code-level support. Based on their response, the current SDK and API does not allow for this functionality (as of iOS 11.3) so it is currently impossible to retrieve the iTunes playlist ID from a playlist created via the Apple Music API.